3.0.9-stable review
Subsystems (109)
PATCH 163/262 rtl8150: rtl8150_disconnect(...) does not need tasklet_disable(...)
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: huajun li <[email protected]>
commit c2e2a313ff8fdc25cedef5e63da712a6a0d35dfe upstream.
Executing cmd 'rmmod rtl8150' does not return(if your device connects to host), the root cause is tasklet_disable() causes tasklet_kill() block, remove it from rtl8150_disconnect().
--- drivers/net/usb/rtl8150.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/usb/rtl8150.c +0 -1
@@ -977,7 +977,6 @@ static void rtl8150_disconnect(struct ususb_set_intfdata (intf,NULL );if (dev) {set_bit (RTL8150_UNPLUG , &dev->flags); -tasklet_disable (&dev->tl);tasklet_kill (&dev->tl);unregister_netdev (dev->netdev);unlink_all_urbs (dev);
PATCH 164/262 USB: EHCI: Fix test mode sequence
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Todorov <[email protected]>
commit 77636c86a600b83de01719efad83567e46d7e8ce upstream.
The sequence to put port in test mode is not complete. According EHCI specification all enabled ports must be put in suspend.
--- drivers/usb/host/ehci-hub.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/usb/host/ehci-hub.c +12 -0
@@ -1120,7 +1120,19 @@ static int ehci_hub_control (if (!selector || selector >5 ) goto error;ehci_quiesce (ehci); + +/* Put all enabled ports into suspend */ +while (ports--) { +u32 __iomem *sreg = + &ehci->regs->port_status[ports]; + + temp =ehci_readl (ehci, sreg) & ~PORT_RWC_BITS ; +if (temp &PORT_PE ) +ehci_writel (ehci, temp |PORT_SUSPEND , + sreg); + }ehci_halt (ehci); + temp =ehci_readl (ehci, status_reg); temp |= selector <<16 ;ehci_writel (ehci, temp, status_reg);break ;
PATCH 165/262 usb/isp1760: Added missing call to usb_hcd_check_unlink_urb() during unlink
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arvid Brodin <[email protected]>
commit 17d3e145a4ad680b3d1b1c30d0696a5bbb2b65c4 upstream.
--- drivers/usb/host/isp1760-hcd.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/host/isp1760-hcd.c +3 -0
@@ -1583,6 +1583,9 @@ static int isp1760_urb_dequeue(struct usint retval =0 ;spin_lock_irqsave (&priv->lock, spinflags); + retval =usb_hcd_check_unlink_urb (hcd, urb, status); +if (retval) + goto out; qh = urb->ep->hcpriv;if (!qh) {
PATCH 166/262 USB: Serial: Add device ID for Sierra Wireless MC8305
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Echtler <[email protected]>
commit 2f1def2695c223b2aa325e5e47d0d64200a45d23 upstream.
A new device ID pair is added for Sierra Wireless MC8305.
--- drivers/usb/serial/qcserial.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/qcserial.c +1 -0
@@ -80,6 +80,7 @@ static const struct usb_device_id id_tab {USB_DEVICE(0x1199, 0x9008)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ {USB_DEVICE(0x1199, 0x9009)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ {USB_DEVICE(0x1199, 0x900a)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */ + {USB_DEVICE(0x1199, 0x9011)}, /* Sierra Wireless Gobi 2000 Modem device (MC8305) */ {USB_DEVICE(0x16d8, 0x8001)}, /* CMDTech Gobi 2000 QDL device (VU922) */ {USB_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */ {USB_DEVICE(0x05c6, 0x9204)}, /* Gobi 2000 QDL device */
PATCH 167/262 USB: Serial: Add PID(0xF7C0) to FTDI SIO driver for a zeitcontrol-device
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Artur Zimmer <[email protected]>
commit ce7e9065958191e6b7ca49d7ed0e1099c486d198 upstream.
Here is a patch for a new PID (zeitcontrol-device mifare-reader FT232BL(like FT232BM but lead free)).
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -156,6 +156,7 @@ static struct ftdi_sio_quirk ftdi_8u2232* /sys/bus/usb/ftdi_sio/new_id, then send patch/report! */ static struct usb_device_id id_table_combined [] = { + {USB_DEVICE (FTDI_VID ,FTDI_ZEITCONTROL_TAGTRACE_MIFARE_PID ) }, {USB_DEVICE (FTDI_VID ,FTDI_CTI_MINI_PID ) }, {USB_DEVICE (FTDI_VID ,FTDI_CTI_NANO_PID ) }, {USB_DEVICE (FTDI_VID ,FTDI_AMC232_PID ) },
drivers/usb/serial/ftdi_sio_ids.h +5 -1
@@ -1162,4 +1162,8 @@/* USB-Nano-485*/ #define FTDI_CTI_NANO_PID 0xF60B - +/* +* ZeitControl cardsystems GmbH rfid-readers http://zeitconrol.de +*/ +/* TagTracer MIFARE*/ +#define FTDI_ZEITCONTROL_TAGTRACE_MIFARE_PID 0xF7C0
PATCH 168/262 usbnet/cdc_ncm: Dont use stack variables for DMA
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josh Boyer <[email protected]>
commit 75bc8ef528f7c4ea7e80384c5593487b6b3b535e upstream.
The cdc_ncm driver still has a few places where stack variables are passed to the cdc_ncm_do_request function. This triggers a stack trace in lib/dma-debug.c if the CONFIG_DEBUG_DMA_API option is set.
Adjust these calls to pass parameters that have been allocated with kzalloc.
--- drivers/net/usb/cdc_ncm.c | 47 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 9 deletions(-)
drivers/net/usb/cdc_ncm.c +38 -9
@@ -229,23 +229,40 @@ static u8 cdc_ncm_setup(struct cdc_ncm_cif (ctx->rx_max !=le32_to_cpu (ctx->ncm_parm.dwNtbInMaxSize)) {if (flags &USB_CDC_NCM_NCAP_NTB_INPUT_SIZE ) { -struct usb_cdc_ncm_ndp_input_size ndp_in_sz; +struct usb_cdc_ncm_ndp_input_size *ndp_in_sz; + + ndp_in_sz =kzalloc (sizeof (*ndp_in_sz),GFP_KERNEL ); +if (!ndp_in_sz) { + err = -ENOMEM ; + goto size_err; + } + err =usb_control_msg (ctx->udev,usb_sndctrlpipe (ctx->udev,0 ),USB_CDC_SET_NTB_INPUT_SIZE ,USB_TYPE_CLASS |USB_DIR_OUT |USB_RECIP_INTERFACE , -0 , iface_no, &ndp_in_sz,8 ,1000 ); +0 , iface_no, ndp_in_sz,8 ,1000 ); +kfree (ndp_in_sz); }else { -__le32 dwNtbInMaxSize =cpu_to_le32 (ctx->rx_max); +__le32 *dwNtbInMaxSize; + dwNtbInMaxSize =kzalloc (sizeof (*dwNtbInMaxSize), +GFP_KERNEL ); +if (!dwNtbInMaxSize) { + err = -ENOMEM ; + goto size_err; + } + *dwNtbInMaxSize =cpu_to_le32 (ctx->rx_max); + err =usb_control_msg (ctx->udev,usb_sndctrlpipe (ctx->udev,0 ),USB_CDC_SET_NTB_INPUT_SIZE ,USB_TYPE_CLASS |USB_DIR_OUT |USB_RECIP_INTERFACE , -0 , iface_no, &dwNtbInMaxSize,4 ,1000 ); +0 , iface_no, dwNtbInMaxSize,4 ,1000 ); +kfree (dwNtbInMaxSize); } - +size_err:if (err <0 )pr_debug ("Setting NTB Input Size failed\n" ); }
@@ -326,19 +343,29 @@ static u8 cdc_ncm_setup(struct cdc_ncm_c/* set Max Datagram Size (MTU) */ if (flags &USB_CDC_NCM_NCAP_MAX_DATAGRAM_SIZE ) { -__le16 max_datagram_size; +__le16 *max_datagram_size;u16 eth_max_sz =le16_to_cpu (ctx->ether_desc->wMaxSegmentSize); + + max_datagram_size =kzalloc (sizeof (*max_datagram_size), +GFP_KERNEL ); +if (!max_datagram_size) { + err = -ENOMEM ; + goto max_dgram_err; + } + err =usb_control_msg (ctx->udev,usb_rcvctrlpipe (ctx->udev,0 ),USB_CDC_GET_MAX_DATAGRAM_SIZE ,USB_TYPE_CLASS |USB_DIR_IN |USB_RECIP_INTERFACE , -0 , iface_no, &max_datagram_size, +0 , iface_no, max_datagram_size,2 ,1000 );if (err <0 ) {pr_debug ("GET_MAX_DATAGRAM_SIZE failed, use size=%u\n" ,CDC_NCM_MIN_DATAGRAM_SIZE ); +kfree (max_datagram_size); }else { - ctx->max_datagram_size =le16_to_cpu (max_datagram_size); + ctx->max_datagram_size = +le16_to_cpu (*max_datagram_size);/* Check Eth descriptor value */ if (eth_max_sz <CDC_NCM_MAX_DATAGRAM_SIZE ) {if (ctx->max_datagram_size > eth_max_sz)
@@ -361,8 +388,10 @@ static u8 cdc_ncm_setup(struct cdc_ncm_cUSB_TYPE_CLASS |USB_DIR_OUT |USB_RECIP_INTERFACE ,0 , - iface_no, &max_datagram_size, + iface_no, max_datagram_size, 2, 1000); +kfree (max_datagram_size); +max_dgram_err:if (err <0 )pr_debug ("SET_MAX_DATAGRAM_SIZE failed\n" ); }
PATCH 169/262 USB: Avoid NULL pointer deref in usb_hcd_alloc_bandwidth.
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarah Sharp <[email protected]>
commit 8a9af4fdf6d5eeb3200a088354d266a87e8260b0 upstream.
usb_ifnum_to_if() can return NULL if the USB device does not have a configuration installed (usb_device->actconfig == NULL), or if we can't find the interface number in the installed configuration. Return an error instead of crashing.
--- drivers/usb/core/hcd.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/core/hcd.c +2 -0
@@ -1764,6 +1764,8 @@ int usb_hcd_alloc_bandwidth(struct usb_dstruct usb_interface *iface =usb_ifnum_to_if (udev, cur_alt->desc.bInterfaceNumber); +if (!iface) +return -EINVAL ;if (iface->resetting_device) {/* * The USB core just reset the device, so the xHCI host
PATCH 170/262 ipheth: iPhone 4 Verizon CDMA USB Product ID add
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kavan Smith <[email protected]>
commit 02009afc223aae43b8e18918fc816e4520791537 upstream.
Add USB product ID for iPhone 4 CDMA Verizon Tested on at least 2 devices
--- drivers/net/usb/ipheth.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/usb/ipheth.c +5 -0
@@ -59,6 +59,7 @@#define USB_PRODUCT_IPHONE_3G 0x1292#define USB_PRODUCT_IPHONE_3GS 0x1294#define USB_PRODUCT_IPHONE_4 0x1297 +#define USB_PRODUCT_IPHONE_4_VZW 0x129c#define IPHETH_USBINTF_CLASS 255#define IPHETH_USBINTF_SUBCLASS 253
@@ -98,6 +99,10 @@ static struct usb_device_id ipheth_table USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4,IPHETH_USBINTF_CLASS ,IPHETH_USBINTF_SUBCLASS , IPHETH_USBINTF_PROTO) }, + { USB_DEVICE_AND_INTERFACE_INFO( +USB_VENDOR_APPLE ,USB_PRODUCT_IPHONE_4_VZW , +IPHETH_USBINTF_CLASS ,IPHETH_USBINTF_SUBCLASS , + IPHETH_USBINTF_PROTO) }, { } };MODULE_DEVICE_TABLE (usb, ipheth_table);
PATCH 171/262 USB: xHCI: prevent infinite loop when processing MSE event
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andiry Xu <[email protected]>
commit c2d7b49f42f50d7fc5cbfd195b785a128723fdf4 upstream.
When a xHC host is unable to handle isochronous transfer in the interval, it reports a Missed Service Error event and skips some tds.
Currently xhci driver handles MSE event in the following ways:
1. When encounter a MSE event, set ep->skip flag, update event ring dequeue pointer and return.
2. When encounter the next event on this ep, the driver will run the do-while loop, fetch td from ep's td_list to find the td corresponding to this event. All tds missed are marked as short transfer(-EXDEV).
The do-while loop will end in two ways:
1. If the td pointed by the event trb is found;
2. If the ep ring's td_list is empty.
However, if a buggy HW reports some unpredicted event (for example, an overrun event following a MSE event while the ep ring is actually not empty), the driver will never find the td, and it will loop until the td_list is empty.
Unfortunately, the spinlock is dropped when give back a urb in the do-while loop. During the spinlock released period, the class driver may still submit urbs and add tds to the td_list. This may cause disaster, since the td_list will never be empty and the loop never ends, and the system hangs.
To fix this, count the number of TDs on the ep ring before skipping TDs, and quit the loop when skipped that number of tds. This guarantees the do-while loop will end after certain number of cycles, and driver will not be trapped in an infinite loop.
--- drivers/usb/host/xhci-ring.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/usb/host/xhci-ring.c +19 -0
@@ -1942,8 +1942,10 @@ static int handle_tx_event(struct xhci_hint status = -EINPROGRESS ;struct urb_priv *urb_priv;struct xhci_ep_ctx *ep_ctx; +struct list_head *tmp;u32 trb_comp_code;int ret =0 ; +int td_num =0 ; slot_id =TRB_TO_SLOT_ID (le32_to_cpu (event->flags)); xdev = xhci->devs[slot_id];
@@ -1965,6 +1967,12 @@ static int handle_tx_event(struct xhci_hreturn -ENODEV ; } +/* Count current td numbers if ep->skip is set */ +if (ep->skip) { +list_for_each (tmp, &ep_ring->td_list) + td_num++; + } + event_dma =le64_to_cpu (event->buffer); trb_comp_code =GET_COMP_CODE (le32_to_cpu (event->transfer_len));/* Look for common error cases */
@@ -2076,7 +2084,18 @@ static int handle_tx_event(struct xhci_h goto cleanup; } +/* We've skipped all the TDs on the ep ring when ep->skip set */ +if (ep->skip && td_num ==0 ) { + ep->skip = false; +xhci_dbg (xhci,"All tds on the ep_ring skipped. " +"Clear skip flag.\n" ); + ret =0 ; + goto cleanup; + } + td = list_entry(ep_ring->td_list.next, struct xhci_td, td_list); +if (ep->skip) + td_num--;/* Is this a TRB in the currently executing TD? */ event_seg = trb_in_td(ep_ring->deq_seg, ep_ring->dequeue,
PATCH 172/262 ASIX: Simplify condition in rx_fixup()
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
commit bc466e678d0a98f445bf3f9c76fedf18e7dcc6b0 upstream.
--- drivers/net/usb/asix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/usb/asix.c +2 -3
@@ -314,10 +314,9 @@ static int asix_rx_fixup(struct usbnet *skb_pull (skb,4 );while (skb->len >0 ) { -if ((short )(header &0x0000ffff ) != - ~((short )((header &0xffff0000 ) >>16 ))) { +if ((header &0xffff ) != ((~header >>16 ) &0xffff ))netdev_err (dev->net,"asix_rx_fixup() Bad Header Length\n" ); - } +/* get the packet length */ size = (u16) (header &0x0000ffff );
PATCH 173/262 ASIX: Use only 11 bits of header for data size
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
commit bca0beb9363f8487ac902931a50eb00180a2d14a upstream.
The AX88772B uses only 11 bits of the header for the actual size. The other bits are used for something else. This causes dmesg full of messages:
asix_rx_fixup() Bad Header Length
This patch trims the check to only 11 bits. I believe on older chips, the remaining 5 top bits are unused.
--- drivers/net/usb/asix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/usb/asix.c +2 -2
@@ -314,11 +314,11 @@ static int asix_rx_fixup(struct usbnet *skb_pull (skb,4 );while (skb->len >0 ) { -if ((header &0xffff ) != ((~header >>16 ) &0xffff )) +if ((header &0x07ff ) != ((~header >>16 ) &0x07ff ))netdev_err (dev->net,"asix_rx_fixup() Bad Header Length\n" );/* get the packet length */ - size = (u16) (header &0x0000ffff ); + size = (u16) (header &0x000007ff );if ((skb->len) - ((size +1 ) &0xfffe ) ==0 ) {u8 alignment = (unsigned long )skb->data &0x3 ;
PATCH 174/262 Bluetooth: Add MacBookAir4,1 support
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pieter-Augustijn Van Malleghem <[email protected]>
commit a63b723d02531f7add0b2b8a0e6a77ee176f1626 upstream.
This patch against current git adds the hardware ID for the Apple MacBookAir4,1, released in July 2011. The device features a BCM2046 USB chip. The patch was inspired by the previous modifications adding support for the MacBookAir3,x.
--- drivers/bluetooth/btusb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/bluetooth/btusb.c +3 -0
@@ -71,6 +71,9 @@ static struct usb_device_id btusb_table[/* Apple MacBookAir3,1, MacBookAir3,2 */ { USB_DEVICE(0x05ac, 0x821b) }, +/* Apple MacBookAir4,1 */ + { USB_DEVICE(0x05ac, 0x821f) }, +/* Apple MacBookPro8,2 */ { USB_DEVICE(0x05ac, 0x821a) },
PATCH 175/262 Bluetooth: Add Toshiba laptops AR30XX device ID
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Mendoza <[email protected]>
commit 8e7c3d2e4ba18ee4cdcc1f89aec944fbff4ce735 upstream.
Blacklist Toshiba-branded AR3011 based AR5B195 [0930:0215] and add to ath3k.c for firmware loading.
--- drivers/bluetooth/ath3k.c | 1 + drivers/bluetooth/btusb.c | 1 + 2 files changed, 2 insertions(+)
drivers/bluetooth/ath3k.c +1 -0
@@ -63,6 +63,7 @@ static struct usb_device_id ath3k_table[/* Atheros AR3011 with sflash firmware*/ { USB_DEVICE(0x0CF3, 0x3002) }, { USB_DEVICE(0x13d3, 0x3304) }, + { USB_DEVICE(0x0930, 0x0215) },/* Atheros AR9285 Malbec with sflash firmware */ { USB_DEVICE(0x03F0, 0x311D) },
drivers/bluetooth/btusb.c +1 -0
@@ -108,6 +108,7 @@ static struct usb_device_id blacklist_ta/* Atheros 3011 with sflash firmware */ { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE }, + { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE }, /* Atheros AR9285 Malbec with sflash firmware */ { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
PATCH 176/262 Bluetooth: Add Atheros AR3012 one PID/VID supported
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Steven.Li" <[email protected]>
commit 2d25f8b462f3b849d8913d02978657ef06e67dd8 upstream.
The new Ath3k needs to download patch and radio table, and it keeps same PID/VID even after downloading the patch and radio table. This patch is to use the bcdDevice (Device Release Number) to judge whether the chip has been patched or not. The init bcdDevice value of the chip is 0x0001, this value increases after patch and radio table downloading.
--- drivers/bluetooth/ath3k.c | 5 +++++ drivers/bluetooth/btusb.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-)
drivers/bluetooth/ath3k.c +5 -0
@@ -376,6 +376,11 @@ static int ath3k_probe(struct usb_interf/* load patch and sysconfig files for AR3012 */ if (id->driver_info &BTUSB_ATH3012 ) { + +/* New firmware with patch and sysconfig files already loaded */ +if (le16_to_cpu (udev->descriptor.bcdDevice) >0x0001 ) +return -ENODEV ; + ret =ath3k_load_patch (udev);if (ret <0 ) {BT_ERR ("Loading patch file failed" );
drivers/bluetooth/btusb.c +11 -1
@@ -54,6 +54,7 @@ static struct usb_driver btusb_driver;#define BTUSB_BCM92035 0x10#define BTUSB_BROKEN_ISOC 0x20#define BTUSB_WRONG_SCO_MTU 0x40 +#define BTUSB_ATH3012 0x80static struct usb_device_id btusb_table[] = {/* Generic Bluetooth USB device */
@@ -114,7 +115,7 @@ static struct usb_device_id blacklist_ta { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE }, /* Atheros 3012 with sflash firmware */ - { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_IGNORE }, + { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, /* Atheros AR5BBU12 with sflash firmware */ { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
@@ -918,6 +919,15 @@ static int btusb_probe(struct usb_interfif (ignore_sniffer && id->driver_info &BTUSB_SNIFFER )return -ENODEV ; +if (id->driver_info &BTUSB_ATH3012 ) { +struct usb_device *udev =interface_to_usbdev (intf); + +/* Old firmware would otherwise let ath3k driver load +* patch and sysconfig files */ +if (le16_to_cpu (udev->descriptor.bcdDevice) <=0x0001 ) +return -ENODEV ; + } + data =kzalloc (sizeof (*data),GFP_KERNEL );if (!data)return -ENOMEM ;
PATCH 177/262 Bluetooth: add support for 2011 mac mini
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jurgen Kramer <[email protected]>
commit f78b68261e80899f81a21dfdf91e2a1456ea8175 upstream.
Today I noticed that the usb bluetooth adapter (BCM2046B1) on my 2011 mac mini was not working. I've created a patch to get it going.
--- drivers/bluetooth/btusb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/bluetooth/btusb.c +3 -0
@@ -78,6 +78,9 @@ static struct usb_device_id btusb_table[/* Apple MacBookPro8,2 */ { USB_DEVICE(0x05ac, 0x821a) }, +/* Apple MacMini5,1 */ + { USB_DEVICE(0x05ac, 0x8281) }, +/* AVM BlueFRITZ! USB v2.0 */ { USB_DEVICE(0x057c, 0x3800) },
PATCH 178/262 btusb: add device entry for Broadcom SoftSailing
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <[email protected]>
commit c510eae377c773241ff0b6369a8f3581da941a51 upstream.
This device declares itself to be vendor specific It therefore needs to be added to the device table to make btusb bind.
--- drivers/bluetooth/btusb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/bluetooth/btusb.c +3 -0
@@ -60,6 +60,9 @@ static struct usb_device_id btusb_table[/* Generic Bluetooth USB device */ { USB_DEVICE_INFO(0xe0, 0x01, 0x01) }, +/* Broadcom SoftSailing reporting vendor specific */ + { USB_DEVICE(0x05ac, 0x21e1) }, +/* Apple MacBookPro 7,1 */ { USB_DEVICE(0x05ac, 0x8213) },
PATCH 179/262 usb_storage: Dont freeze in usb-stor-scan
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Seth Forshee <[email protected]>
commit f02fe890ece7d695a5744b20525d45312382e6e4 upstream.
Scanning cannot be run during suspend or hibernation, but if usb-stor-scan freezes another thread waiting on scanning to complete may fail to freeze.
However, if usb-stor-scan is left freezable without ever actually freezing then the freezer will wait on it to exit, and threads waiting for scanning to finish will no longer be blocked. One problem with this approach is that usb-stor-scan has a delay to wait for devices to settle (which is currently the only point where it can freeze). To work around this we can request that the freezer send a fake signal when freezing, then use interruptible sleep to wake the thread early when freezing happens.
To make this happen, the following changes are made to usb-stor-scan:
* Use set_freezable_with_signal() instead of set_freezable() to request a fake signal when freezing
* Use wait_event_interruptible_timeout() instead of wait_event_freezable_timeout() to avoid freezing
--- drivers/usb/storage/usb.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/usb/storage/usb.c +13 -3
@@ -831,12 +831,22 @@ static int usb_stor_scan_thread(void * _dev_dbg (dev,"device found\n" ); -set_freezable (); -/* Wait for the timeout to expire or for a disconnect */ +set_freezable_with_signal (); +/* +* Wait for the timeout to expire or for a disconnect +* +* We can't freeze in this thread or we risk causing khubd to +* fail to freeze, but we can't be non-freezable either. Nor can +* khubd freeze while waiting for scanning to complete as it may +* hold the device lock, causing a hang when suspending devices. +* So we request a fake signal when freezing and use +* interruptible sleep to kick us out of our wait early when +* freezing happens. +*/ if (delay_use >0 ) {dev_dbg (dev,"waiting for device to settle " "before scanning\n" ); -wait_event_freezable_timeout (us->delay_wait, +wait_event_interruptible_timeout (us->delay_wait,test_bit (US_FLIDX_DONT_SCAN , &us->dflags), delay_use *HZ ); }
PATCH 180/262 xhci: If no endpoints changed, dont issue BW command.
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarah Sharp <[email protected]>
commit 2dc3753997f3c80ce8b950242ab9bb3fb936acfd upstream.
Some alternate interface settings have no endpoints associated with them. This shows up in some USB webcams, particularly the Logitech HD 1080p, which uses the uvcvideo driver. If a driver switches between two alt settings with no endpoints, there is no need to issue a configure endpoint command, because there is no endpoint information to update.
The only time a configure endpoint command with just the add slot flag set makes sense is when the driver is updating hub characteristics in the slot context. However, that code never calls xhci_check_bandwidth, so we should be safe not issuing a command if only the slot context add flag is set.
--- drivers/usb/host/xhci.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/host/xhci.c +6 -0
@@ -1889,6 +1889,12 @@ int xhci_check_bandwidth(struct usb_hcd ctrl_ctx->add_flags |=cpu_to_le32 (SLOT_FLAG ); ctrl_ctx->add_flags &=cpu_to_le32 (~EP0_FLAG ); ctrl_ctx->drop_flags &=cpu_to_le32 (~(SLOT_FLAG |EP0_FLAG )); + +/* Don't issue the command if there's no endpoints to update. */ +if (ctrl_ctx->add_flags ==cpu_to_le32 (SLOT_FLAG ) && + ctrl_ctx->drop_flags ==0 ) +return 0 ; +xhci_dbg (xhci,"New Input Control Context:\n" ); slot_ctx =xhci_get_slot_ctx (xhci, virt_dev->in_ctx); xhci_dbg_ctx(xhci, virt_dev->in_ctx,
PATCH 181/262 xHCI: test and clear RWC bit
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andiry Xu <[email protected]>
commit d2f52c9e585bbb1a3c164e02b8dcd0d996c67353 upstream.
Introduce xhci_test_and_clear_bit() to clear RWC bit in PORTSC register.
--- drivers/usb/host/xhci-hub.c | 22 ++++++++++++++++------ drivers/usb/host/xhci-ring.c | 6 ++---- drivers/usb/host/xhci.h | 2 ++ 3 files changed, 20 insertions(+), 10 deletions(-)
drivers/usb/host/xhci-hub.c +16 -6
@@ -392,6 +392,20 @@ static int xhci_get_ports(struct usb_hcdreturn max_ports; } +/* Test and clear port RWC bit */ +void xhci_test_and_clear_bit (struct xhci_hcd *xhci,__le32 __iomem **port_array, +int port_id,u32 port_bit) +{ +u32 temp; + + temp =xhci_readl (xhci, port_array[port_id]); +if (temp & port_bit) { + temp =xhci_port_state_to_neutral (temp); + temp |= port_bit; +xhci_writel (xhci, temp, port_array[port_id]); + } +} +int xhci_hub_control (struct usb_hcd *hcd,u16 typeReq,u16 wValue,u16 wIndex,char *buf,u16 wLength) {
@@ -938,12 +952,8 @@ int xhci_bus_resume(struct usb_hcd *hcd)spin_lock_irqsave (&xhci->lock, flags);/* Clear PLC */ - temp =xhci_readl (xhci, port_array[port_index]); -if (temp &PORT_PLC ) { - temp =xhci_port_state_to_neutral (temp); - temp |=PORT_PLC ; -xhci_writel (xhci, temp, port_array[port_index]); - } +xhci_test_and_clear_bit (xhci, port_array, port_index, +PORT_PLC ); slot_id =xhci_find_slot_id_by_port (hcd, xhci, port_index +1 );
drivers/usb/host/xhci-ring.c +2 -4
@@ -1347,10 +1347,8 @@ static void handle_port_status(struct xhxhci_ring_device (xhci, slot_id);xhci_dbg (xhci,"resume SS port %d finished\n" , port_id);/* Clear PORT_PLC */ - temp =xhci_readl (xhci, port_array[faked_port_index]); - temp =xhci_port_state_to_neutral (temp); - temp |=PORT_PLC ; -xhci_writel (xhci, temp, port_array[faked_port_index]); +xhci_test_and_clear_bit (xhci, port_array, + faked_port_index,PORT_PLC ); }else {xhci_dbg (xhci,"resume HS port %d\n" , port_id); bus_state->resume_done[faked_port_index] = jiffies +
drivers/usb/host/xhci.h +2 -0
@@ -1566,6 +1566,8 @@ void xhci_ring_ep_doorbell(struct xhci_h unsigned int ep_index, unsigned int stream_id);/* xHCI roothub code */ +void xhci_test_and_clear_bit (struct xhci_hcd *xhci,__le32 __iomem **port_array, +int port_id,u32 port_bit);int xhci_hub_control (struct usb_hcd *hcd,u16 typeReq,u16 wValue,u16 wIndex,char *buf,u16 wLength);int xhci_hub_status_data (struct usb_hcd *hcd,char *buf);
PATCH 182/262 xHCI: Clear PLC for USB2 root hub ports
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andiry Xu <[email protected]>
commit 6fd4562178508a0949c9fdecd8558d8b10d671bd upstream.
When the link state changes, xHC will report a port status change event and set the PORT_PLC bit, for both USB3 and USB2 root hub ports.
The PLC will be cleared by usbcore for USB3 root hub ports, but not for USB2 ports, because they do not report USB_PORT_STAT_C_LINK_STATE in wPortChange.
Clear it for USB2 root hub ports in handle_port_status().
--- drivers/usb/host/xhci-ring.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/host/xhci-ring.c +4 -0
@@ -1359,6 +1359,10 @@ static void handle_port_status(struct xh } } +if (hcd->speed !=HCD_USB3 ) +xhci_test_and_clear_bit (xhci, port_array, faked_port_index, +PORT_PLC ); + cleanup:/* Update event ring dequeue pointer before dropping the lock */ inc_deq (xhci, xhci->event_ring, true);
PATCH 183/262 can bcm: fix incomplete tx_setup fix
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Hartkopp <[email protected]>
commit 12d0d0d3a7349daa95dbfd5d7df8146255bc7c67 upstream.
The commit aabdcb0b553b9c9547b1a506b34d55a764745870 ("can bcm: fix tx_setup off-by-one errors") fixed only a part of the original problem reported by Andre Naujoks. It turned out that the original code needed to be re-ordered to reduce complexity and to finally fix the reported frame counting issues.
--- net/can/bcm.c | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-)
net/can/bcm.c +21 -27
@@ -343,6 +343,18 @@ static void bcm_send_to_user(struct bcm_ } } +static void bcm_tx_start_timer (struct bcm_op *op) +{ +if (op->kt_ival1.tv64 && op->count) +hrtimer_start (&op->timer, +ktime_add (ktime_get (), op->kt_ival1), +HRTIMER_MODE_ABS ); +else if (op->kt_ival2.tv64) +hrtimer_start (&op->timer, +ktime_add (ktime_get (), op->kt_ival2), +HRTIMER_MODE_ABS ); +} +static void bcm_tx_timeout_tsklet (unsigned long data) {struct bcm_op *op = (struct bcm_op *)data;
@@ -364,23 +376,12 @@ static void bcm_tx_timeout_tsklet(unsignbcm_send_to_user (op, &msg_head,NULL ,0 ); } - -/* send (next) frame */ bcm_can_tx (op); -hrtimer_start (&op->timer, -ktime_add (ktime_get (), op->kt_ival1), -HRTIMER_MODE_ABS ); - }else { -if (op->kt_ival2.tv64) { + }else if (op->kt_ival2.tv64) +bcm_can_tx (op); -/* send (next) frame */ -bcm_can_tx (op); -hrtimer_start (&op->timer, -ktime_add (ktime_get (), op->kt_ival2), -HRTIMER_MODE_ABS ); - } - } +bcm_tx_start_timer (op); }/*
@@ -960,28 +961,21 @@ static int bcm_tx_setup(struct bcm_msg_hhrtimer_cancel (&op->timer); } -if ((op->flags &STARTTIMER ) && - ((op->kt_ival1.tv64 && op->count) || op->kt_ival2.tv64)) { - +if (op->flags &STARTTIMER ) { +hrtimer_cancel (&op->timer);/* spec: send can_frame when starting timer */ op->flags |=TX_ANNOUNCE ; - -/* only start timer when having more frames than sent below */ -if (op->kt_ival1.tv64 && (op->count >1 )) { -/* op->count-- is done in bcm_tx_timeout_tsklet */ -hrtimer_start (&op->timer, op->kt_ival1, -HRTIMER_MODE_REL ); - }else -hrtimer_start (&op->timer, op->kt_ival2, -HRTIMER_MODE_REL ); }if (op->flags &TX_ANNOUNCE ) {bcm_can_tx (op); -if (op->kt_ival1.tv64 && (op->count >0 )) +if (op->count) op->count--; } +if (op->flags &STARTTIMER ) +bcm_tx_start_timer (op); +return msg_head->nframes *CFSIZ +MHSIZ ; }
PATCH 184/262 powerpc: remove superfluous PageTail checks on the pte gup_fast
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Arcangeli <[email protected]>
commit 2839bdc1bfc0af76a2f0f11eca011590520a04fa upstream.
This part of gup_fast doesn't seem capable of handling hugetlbfs ptes, those should be handled by gup_hugepd only, so these checks are superfluous.
Plus if this wasn't a noop, it would have oopsed because, the insistence of using the speculative refcounting would trigger a VM_BUG_ON if a tail page was encountered in the page_cache_get_speculative().
--- arch/powerpc/mm/gup.c | 13 ------------- 1 file changed, 13 deletions(-)
arch/powerpc/mm/gup.c +0 -13
@@ -16,17 +16,6 @@#ifdef __HAVE_ARCH_PTE_SPECIAL -static inline void get_huge_page_tail (struct page *page) -{ -/* -* __split_huge_page_refcount() cannot run -* from under us. -*/ -VM_BUG_ON (page_mapcount (page) <0 ); -VM_BUG_ON (atomic_read (&page->_count) !=0 ); -atomic_inc (&page->_mapcount); -} -/* * The performance critical leaf functions are made noinline otherwise gcc * inlines everything into a single function which results in too much
@@ -58,8 +47,6 @@ static noinline int gup_pte_range(pmd_tput_page (page);return 0 ; } -if (PageTail (page)) -get_huge_page_tail (page); pages[*nr] = page; (*nr)++;
PATCH 185/262 powerpc: get_hugepte() dont put_page() the wrong page
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Arcangeli <[email protected]>
commit 405e44f2e312dd5dd63e5a9f459bffcbcd4368ef upstream.
"page" may have changed to point to the next hugepage after the loop completed, The references have been taken on the head page, so the put_page must happen there too.
This is a longstanding issue pre-thp inclusion.
It's totally unclear how these page_cache_add_speculative and pte_val(pte) != pte_val(*ptep) checks are necessary across all the powerpc gup_fast code, when x86 doesn't need any of that: there's no way the page can be freed with irq disabled so we're guaranteed the atomic_inc will happen on a page with page_count > 0 (so not needing the speculative check).
The pte check is also meaningless on x86: no need to rollback on x86 if the pte changed, because the pte can still change a CPU tick after the check succeeded and it won't be rolled back in that case. The important thing is we got a reference on a valid page that was mapped there a CPU tick ago. So not knowing the soft tlb refill code of ppc64 in great detail I'm not removing the "speculative" page_count increase and the pte checks across all the code, but unless there's a strong reason for it they should be later cleaned up too.
If a pte can change from huge to non-huge (like it could happen with THP) passing a pte_t *ptep to gup_hugepte() would also require to repeat the is_hugepd in gup_hugepte(), but that shouldn't happen with hugetlbfs only so I'm not altering that.
--- arch/powerpc/mm/hugetlbpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/hugetlbpage.c +1 -1
@@ -429,7 +429,7 @@ static noinline int gup_hugepte(pte_t *pif (unlikely (pte_val (pte) !=pte_val (*ptep))) {/* Could be optimized better */ while (*nr) { -put_page (page); +put_page (head); (*nr)--; } }
PATCH 186/262 powerpc: gup_hugepte() avoid freeing the head page too many times
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Arcangeli <[email protected]>
commit 8596468487e2062cae2aad56e973784e03959245 upstream.
We only taken "refs" pins on the head page not "*nr" pins.
--- arch/powerpc/mm/hugetlbpage.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/powerpc/mm/hugetlbpage.c +2 -3
@@ -428,10 +428,9 @@ static noinline int gup_hugepte(pte_t *pif (unlikely (pte_val (pte) !=pte_val (*ptep))) {/* Could be optimized better */ -while (*nr) { + *nr -= refs; +while (refs--)put_page (head); - (*nr)--; - } }return 1 ;
PATCH 187/262 powerpc: gup_hugepte() support THP based tail recounting
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Arcangeli <[email protected]>
commit 3526741f0964c88bc2ce511e1078359052bf225b upstream.
Up to this point the code assumed old refcounting for hugepages (pre-thp). This updates the code directly to the thp mapcount tail page refcounting.
--- arch/powerpc/mm/hugetlbpage.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
arch/powerpc/mm/hugetlbpage.c +23 -1
@@ -385,12 +385,23 @@ follow_huge_pmd(struct mm_struct *mm, unreturn NULL ; } +static inline void get_huge_page_tail (struct page *page) +{ +/* +* __split_huge_page_refcount() cannot run +* from under us. +*/ +VM_BUG_ON (page_mapcount (page) <0 ); +VM_BUG_ON (atomic_read (&page->_count) !=0 ); +atomic_inc (&page->_mapcount); +} + static noinline int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,unsigned long end,int write,struct page **pages,int *nr) {unsigned long mask;unsigned long pte_end; -struct page *head, *page; +struct page *head, *page, *tail;pte_t pte;int refs;
@@ -413,6 +424,7 @@ static noinline int gup_hugepte(pte_t *p head =pte_page (pte); page = head + ((addr & (sz-1 )) >>PAGE_SHIFT ); + tail = page; do { VM_BUG_ON(compound_head(page) != head); pages[*nr] = page;
@@ -431,6 +443,16 @@ static noinline int gup_hugepte(pte_t *p *nr -= refs;while (refs--)put_page (head); + }else { +/* +* Any tail page need their mapcount reference taken +* before we return. +*/ +while (refs--) { +if (PageTail (tail)) +get_huge_page_tail (tail); + tail++; + } }return 1 ;
PATCH 188/262 powerpc: gup_huge_pmd() return 0 if pte changes
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Arcangeli <[email protected]>
commit cf592bf768c4fa40282b8fce58a80820065de2cb upstream.
powerpc didn't return 0 in that case, if it's rolling back the *nr pointer it should also return zero to avoid adding pages to the array at the wrong offset.
--- arch/powerpc/mm/hugetlbpage.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
arch/powerpc/mm/hugetlbpage.c +11 -10
@@ -443,16 +443,17 @@ static noinline int gup_hugepte(pte_t *p *nr -= refs;while (refs--)put_page (head); - }else { -/* -* Any tail page need their mapcount reference taken -* before we return. -*/ -while (refs--) { -if (PageTail (tail)) -get_huge_page_tail (tail); - tail++; - } +return 0 ; + } + +/* +* Any tail page need their mapcount reference taken before we +* return. +*/ +while (refs--) { +if (PageTail (tail)) +get_huge_page_tail (tail); + tail++; }return 1 ;
PATCH 189/262 s390: gup_huge_pmd() support THP tail recounting
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Arcangeli <[email protected]>
commit 220a2eb228d032acde60e9fd044ca802706ff583 upstream.
Up to this point the code assumed old refcounting for hugepages (pre-thp). This updates the code directly to the thp mapcount tail page refcounting.
--- arch/s390/mm/gup.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
arch/s390/mm/gup.c +23 -1
@@ -48,11 +48,22 @@ static inline int gup_pte_range(pmd_t *preturn 1 ; } +static inline void get_huge_page_tail (struct page *page) +{ +/* +* __split_huge_page_refcount() cannot run +* from under us. +*/ +VM_BUG_ON (page_mapcount (page) <0 ); +VM_BUG_ON (atomic_read (&page->_count) !=0 ); +atomic_inc (&page->_mapcount); +} +static inline int gup_huge_pmd (pmd_t *pmdp,pmd_t pmd,unsigned long addr,unsigned long end,int write,struct page **pages,int *nr) {unsigned long mask, result; -struct page *head, *page; +struct page *head, *page, *tail;int refs; result = write ?0 : _SEGMENT_ENTRY_RO;
@@ -64,6 +75,7 @@ static inline int gup_huge_pmd(pmd_t *pm refs =0 ; head =pmd_page (pmd); page = head + ((addr & ~PMD_MASK ) >>PAGE_SHIFT ); + tail = page; do { VM_BUG_ON(compound_head(page) != head); pages[*nr] = page;
@@ -81,6 +93,16 @@ static inline int gup_huge_pmd(pmd_t *pm *nr -= refs;while (refs--)put_page (head); + }else { +/* +* Any tail page need their mapcount reference taken +* before we return. +*/ +while (refs--) { +if (PageTail (tail)) +get_huge_page_tail (tail); + tail++; + } }return 1 ;
PATCH 190/262 s390: gup_huge_pmd() return 0 if pte changes
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Arcangeli <[email protected]>
commit 0693bc9ce2cc4f6a1b9c3c05790fc149a74c0b87 upstream.
s390 didn't return 0 in that case, if it's rolling back the *nr pointer it should also return zero to avoid adding pages to the array at the wrong offset.
--- arch/s390/mm/gup.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
arch/s390/mm/gup.c +11 -10
@@ -93,16 +93,17 @@ static inline int gup_huge_pmd(pmd_t *pm *nr -= refs;while (refs--)put_page (head); - }else { -/* -* Any tail page need their mapcount reference taken -* before we return. -*/ -while (refs--) { -if (PageTail (tail)) -get_huge_page_tail (tail); - tail++; - } +return 0 ; + } + +/* +* Any tail page need their mapcount reference taken before we +* return. +*/ +while (refs--) { +if (PageTail (tail)) +get_huge_page_tail (tail); + tail++; }return 1 ;
PATCH 191/262 thp: share get_huge_page_tail()
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Arcangeli <[email protected]>
commit b35a35b556f5e6b7993ad0baf20173e75c09ce8c upstream.
This avoids duplicating the function in every arch gup_fast.
--- arch/powerpc/mm/hugetlbpage.c | 11 ----------- arch/s390/mm/gup.c | 11 ----------- arch/x86/mm/gup.c | 11 ----------- include/linux/mm.h | 11 +++++++++++ 4 files changed, 11 insertions(+), 33 deletions(-)
arch/powerpc/mm/hugetlbpage.c +0 -11
@@ -385,17 +385,6 @@ follow_huge_pmd(struct mm_struct *mm, unreturn NULL ; } -static inline void get_huge_page_tail (struct page *page) -{ -/* -* __split_huge_page_refcount() cannot run -* from under us. -*/ -VM_BUG_ON (page_mapcount (page) <0 ); -VM_BUG_ON (atomic_read (&page->_count) !=0 ); -atomic_inc (&page->_mapcount); -} - static noinline int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,unsigned long end,int write,struct page **pages,int *nr) {
arch/s390/mm/gup.c +0 -11
@@ -48,17 +48,6 @@ static inline int gup_pte_range(pmd_t *preturn 1 ; } -static inline void get_huge_page_tail (struct page *page) -{ -/* -* __split_huge_page_refcount() cannot run -* from under us. -*/ -VM_BUG_ON (page_mapcount (page) <0 ); -VM_BUG_ON (atomic_read (&page->_count) !=0 ); -atomic_inc (&page->_mapcount); -} -static inline int gup_huge_pmd (pmd_t *pmdp,pmd_t pmd,unsigned long addr,unsigned long end,int write,struct page **pages,int *nr) {
arch/x86/mm/gup.c +0 -11
@@ -108,17 +108,6 @@ static inline void get_head_page_multiplSetPageReferenced (page); } -static inline void get_huge_page_tail (struct page *page) -{ -/* -* __split_huge_page_refcount() cannot run -* from under us. -*/ -VM_BUG_ON (page_mapcount (page) <0 ); -VM_BUG_ON (atomic_read (&page->_count) !=0 ); -atomic_inc (&page->_mapcount); -} - static noinline int gup_huge_pmd(pmd_t pmd, unsigned long addr,unsigned long end,int write,struct page **pages,int *nr) {
include/linux/mm.h +11 -0
@@ -375,6 +375,17 @@ static inline int page_count(struct pagereturn atomic_read (&compound_head (page)->_count); } +static inline void get_huge_page_tail (struct page *page) +{ +/* +* __split_huge_page_refcount() cannot run +* from under us. +*/ +VM_BUG_ON (page_mapcount (page) <0 ); +VM_BUG_ON (atomic_read (&page->_count) !=0 ); +atomic_inc (&page->_mapcount); +} +extern bool __get_page_tail (struct page *page);static inline void get_page (struct page *page)
PATCH 192/262 bridge: leave carrier on for empty bridge
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: stephen hemminger <[email protected]>
[ Upstream commit b64b73d7d0c480f75684519c6134e79d50c1b341 ]
This resolves a regression seen by some users of bridging. Some users use the bridge like a dummy device.
They expect to be able to put an IPv6 address on the device with no ports attached. Although there are better ways of doing this, there is no reason to not allow it.
Note: the bridge still will reflect the state of ports in the bridge if there are any added.
--- net/bridge/br_device.c | 3 --- 1 file changed, 3 deletions(-)
net/bridge/br_device.c +0 -3
@@ -91,7 +91,6 @@ static int br_dev_open(struct net_device {struct net_bridge *br =netdev_priv (dev); -netif_carrier_off (dev);netdev_update_features (dev);netif_start_queue (dev);br_stp_enable_bridge (br);
@@ -108,8 +107,6 @@ static int br_dev_stop(struct net_device {struct net_bridge *br =netdev_priv (dev); -netif_carrier_off (dev); -br_stp_disable_bridge (br);br_multicast_stop (br);
PATCH 193/262 net: Unlock sock before calling sk_free()
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
[ Upstream commit b0691c8ee7c28a72748ff32e91b165ec12ae4de6 ]
--- net/core/sock.c | 1 + 1 file changed, 1 insertion(+)
net/core/sock.c +1 -0
@@ -1257,6 +1257,7 @@ struct sock *sk_clone(const struct sock/* It is still raw copy of parent, so invalidate * destructor and make plain sk_free() */ newsk->sk_destruct =NULL ; +bh_unlock_sock (newsk);sk_free (newsk); newsk =NULL ; goto out;
PATCH 194/262 ALSA: ua101: fix crash when unplugging
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Ladisch <[email protected]>
commit 862a6244eb9f9f5123fe819454fcfcae0ee1f2f9 upstream.
If the device is unplugged while running, it is possible for a PCM device to be closed after the disconnect callback has returned. This means that kill_stream_urb() and disable_iso_interface() would try to access already-invalid or freed USB data structures.
The function free_usb_related_resources() was intended to prevent this, but forgot to clear the affected variables.
--- sound/usb/misc/ua101.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-)
sound/usb/misc/ua101.c +21 -7
@@ -459,7 +459,8 @@ static void kill_stream_urbs(struct ua10unsigned int i;for (i =0 ; i < stream->queue_length; ++i) -usb_kill_urb (&stream->urbs[i]->urb); +if (stream->urbs[i]) +usb_kill_urb (&stream->urbs[i]->urb); }static int enable_iso_interface (struct ua101 *ua,unsigned int intf_index)
@@ -484,6 +485,9 @@ static void disable_iso_interface(struct {struct usb_host_interface *alts; +if (!ua->intf[intf_index]) +return ; + alts = ua->intf[intf_index]->cur_altsetting;if (alts->desc.bAlternateSetting !=0 ) { int err = usb_set_interface(ua->dev,
@@ -1144,27 +1148,37 @@ static void free_stream_urbs(struct ua10 {unsigned int i; -for (i =0 ; i < stream->queue_length; ++i) +for (i =0 ; i < stream->queue_length; ++i) {kfree (stream->urbs[i]); + stream->urbs[i] =NULL ; + } }static void free_usb_related_resources (struct ua101 *ua,struct usb_interface *interface) {unsigned int i; +struct usb_interface *intf; +mutex_lock (&ua->mutex);free_stream_urbs (&ua->capture);free_stream_urbs (&ua->playback); +mutex_unlock (&ua->mutex);free_stream_buffers (ua, &ua->capture);free_stream_buffers (ua, &ua->playback); -for (i =0 ; i <ARRAY_SIZE (ua->intf); ++i) -if (ua->intf[i]) { -usb_set_intfdata (ua->intf[i],NULL ); -if (ua->intf[i] != interface) +for (i =0 ; i <ARRAY_SIZE (ua->intf); ++i) { +mutex_lock (&ua->mutex); + intf = ua->intf[i]; + ua->intf[i] =NULL ; +mutex_unlock (&ua->mutex); +if (intf) { +usb_set_intfdata (intf,NULL ); +if (intf != interface)usb_driver_release_interface (&ua101_driver, - ua->intf[i]); + intf); } + } }static void ua101_card_free (struct snd_card *card)
PATCH 195/262 ALSA: hda - Disable power-widget control for IDT 92HD83/93 as default
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Chin <[email protected]>
commit 35c11777b906042eca9e6f1c03e464726c7faa07 upstream.
The power-widget control in patch_stac92hd83xxx() never worked properly, thus it's safer to turn it off as default for now.
--- sound/pci/hda/patch_sigmatel.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)
sound/pci/hda/patch_sigmatel.c +1 -19
@@ -5465,26 +5465,8 @@ again:stac92xx_set_config_regs (codec, stac92hd83xxx_brd_tbl[spec->board_config]); -switch (codec->vendor_id) { -case 0x111d76d1 : -case 0x111d76d9 : -case 0x111d76df : -case 0x111d76e5 : -case 0x111d7666 : -case 0x111d7667 : -case 0x111d7668 : -case 0x111d7669 : -case 0x111d76e3 : -case 0x111d7604 : -case 0x111d76d4 : -case 0x111d7605 : -case 0x111d76d5 : -case 0x111d76e7 : -if (spec->board_config ==STAC_92HD83XXX_PWR_REF ) -break ; +if (spec->board_config !=STAC_92HD83XXX_PWR_REF ) spec->num_pwrs =0 ; -break ; - } codec->patch_ops = stac92xx_patch_ops;
PATCH 196/262 ALSA: hda - Add support for 92HD65 / 92HD66 family of codecs
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Chin <[email protected]>
commit ad5d8755116b431f0709c745ee17cb567a478d43 upstream.
These codecs have SPDIF-in, which is new to the 92HD83xxx compatible families, so a bit of logic is added to support them.
--- sound/pci/hda/patch_sigmatel.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
sound/pci/hda/patch_sigmatel.c +17 -1
@@ -5486,7 +5486,11 @@ again: }#endif - err =stac92xx_parse_auto_config (codec,0x1d ,0 ); +/* 92HD65/66 series has S/PDIF-IN */ +if (codec->vendor_id >=0x111d76e8 && codec->vendor_id <=0x111d76f3 ) + err =stac92xx_parse_auto_config (codec,0x1d ,0x22 ); +else + err =stac92xx_parse_auto_config (codec,0x1d ,0 );if (!err) {if (spec->board_config <0 ) { printk(KERN_WARNING "hda_codec: No auto-config is "
@@ -6369,6 +6373,18 @@ static const struct hda_codec_preset snd { .id = 0x111d76e3, .name = "92HD98BXX", .patch = patch_stac92hd83xxx}, { .id = 0x111d76e5, .name = "92HD99BXX", .patch = patch_stac92hd83xxx}, { .id = 0x111d76e7, .name = "92HD90BXX", .patch = patch_stac92hd83xxx}, + { .id = 0x111d76e8, .name = "92HD66B1X5", .patch = patch_stac92hd83xxx}, + { .id = 0x111d76e9, .name = "92HD66B2X5", .patch = patch_stac92hd83xxx}, + { .id = 0x111d76ea, .name = "92HD66B3X5", .patch = patch_stac92hd83xxx}, + { .id = 0x111d76eb, .name = "92HD66C1X5", .patch = patch_stac92hd83xxx}, + { .id = 0x111d76ec, .name = "92HD66C2X5", .patch = patch_stac92hd83xxx}, + { .id = 0x111d76ed, .name = "92HD66C3X5", .patch = patch_stac92hd83xxx}, + { .id = 0x111d76ee, .name = "92HD66B1X3", .patch = patch_stac92hd83xxx}, + { .id = 0x111d76ef, .name = "92HD66B2X3", .patch = patch_stac92hd83xxx}, + { .id = 0x111d76f0, .name = "92HD66B3X3", .patch = patch_stac92hd83xxx}, + { .id = 0x111d76f1, .name = "92HD66C1X3", .patch = patch_stac92hd83xxx}, + { .id = 0x111d76f2, .name = "92HD66C2X3", .patch = patch_stac92hd83xxx}, + { .id = 0x111d76f3, .name = "92HD66C3/65", .patch = patch_stac92hd83xxx}, {} /* terminator */ };
PATCH 197/262 ALSA: hda/realtek - Skip invalid digital out pins
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 51e4152a969aa6d2306492ebf143932dcb535c9b upstream.
Some BIOS report invalid pins as digital output pins. The driver checks the connection but it doesn't do it fully correctly, and it leaves some undefined value as the audio-out widget, which makes the driver spewing warnings. This patch fixes the issue.
Reference: https://bugzilla.novell.com/show_bug.cgi?id=727348
--- sound/pci/hda/patch_realtek.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
sound/pci/hda/patch_realtek.c +7 -5
@@ -2088,25 +2088,27 @@ static void alc_auto_init_digital(structstatic void alc_auto_parse_digital (struct hda_codec *codec) {struct alc_spec *spec = codec->spec; -int i, err; +int i, err, nums;hda_nid_t dig_nid;/* support multiple SPDIFs; the secondary is set up as a slave */ + nums =0 ;for (i =0 ; i < spec->autocfg.dig_outs; i++) { err =snd_hda_get_connections (codec, spec->autocfg.dig_out_pins[i], &dig_nid,1 ); -if (err <0 ) +if (err <=0 )continue ; -if (!i) { +if (!nums) { spec->multiout.dig_out_nid = dig_nid; spec->dig_out_type = spec->autocfg.dig_out_type[0 ]; }else { spec->multiout.slave_dig_outs = spec->slave_dig_outs; -if (i >=ARRAY_SIZE (spec->slave_dig_outs) -1 ) +if (nums >=ARRAY_SIZE (spec->slave_dig_outs) -1 )break ; - spec->slave_dig_outs[i -1 ] = dig_nid; + spec->slave_dig_outs[nums -1 ] = dig_nid; } + nums++; }if (spec->autocfg.dig_in_pin) {
PATCH 198/262 drm/radeon: avoid bouncing connector status btw disconnected & unknown
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jerome Glisse <[email protected]>
commit 340764465aa4a586ca332e61ae64883e5ad6f183 upstream.
Since force handling rework of d0d0a225e6ad43314c9aa7ea081f76adc5098ad4 we could end up bouncing connector status btw disconnected and unknown. When connector status change a call to output_poll_changed happen which in turn ask again for detect but with force set.
So set the load detect flags whenever we report the connector as connected or unknown this avoid bouncing btw disconnected and unknown.
--- drivers/gpu/drm/radeon/radeon_connectors.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_connectors.c +3 -2
@@ -755,7 +755,7 @@ radeon_vga_detect(struct drm_connector *if (radeon_connector->dac_load_detect && encoder) { encoder_funcs = encoder->helper_private; ret = encoder_funcs->detect (encoder, connector); -if (ret == connector_status_connected) +if (ret != connector_status_disconnected) radeon_connector->detected_by_load = true; } }
@@ -996,8 +996,9 @@ radeon_dvi_detect(struct drm_connector * ret = encoder_funcs->detect (encoder, connector);if (ret == connector_status_connected) { radeon_connector->use_digital = false; - radeon_connector->detected_by_load = true; } +if (ret != connector_status_disconnected) + radeon_connector->detected_by_load = true; }break ; }
PATCH 199/262 drm/radeon/kms: split MSI check into a separate function
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 8f6c25c59b0c895c68cae59d1b34e9a7b36971bc upstream.
This makes it easier to add quirks for certain systems.
--- drivers/gpu/drm/radeon/radeon_irq_kms.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_irq_kms.c +23 -6
@@ -108,6 +108,27 @@ void radeon_driver_irq_uninstall_kms(strradeon_irq_set (rdev); } +static bool radeon_msi_ok (struct radeon_device *rdev) +{ +/* RV370/RV380 was first asic with MSI support */ +if (rdev->family <CHIP_RV380 ) +return false; + +/* MSIs don't work on AGP */ +if (rdev->flags &RADEON_IS_AGP ) +return false; + +if (rdev->flags &RADEON_IS_IGP ) { +/* APUs work fine with MSIs */ +if (rdev->family >=CHIP_PALM ) +return true; +/* lots of IGPs have problems with MSIs */ +return false; + } + +return true; +} +int radeon_irq_kms_init (struct radeon_device *rdev) {int i;
@@ -124,12 +145,8 @@ int radeon_irq_kms_init(struct radeon_de }/* enable msi */ rdev->msi_enabled =0 ; -/* MSIs don't seem to work reliably on all IGP -* chips. Disable MSI on them for now. -*/ -if ((rdev->family >=CHIP_RV380 ) && - ((!(rdev->flags &RADEON_IS_IGP )) || (rdev->family >=CHIP_PALM )) && - (!(rdev->flags &RADEON_IS_AGP ))) { + +if (radeon_msi_ok (rdev)) {int ret =pci_enable_msi (rdev->pdev);if (!ret) { rdev->msi_enabled =1 ;
PATCH 200/262 drm/radeon/kms: Add MSI quirk for HP RS690
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit b362105f7f5223fa4d2e03ceeea0e51da754ccc6 upstream.
Some HP laptops only seem to work with MSIs. This looks like a platform/bios bug.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=37679
--- drivers/gpu/drm/radeon/radeon_irq_kms.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/radeon/radeon_irq_kms.c +7 -0
@@ -118,6 +118,13 @@ static bool radeon_msi_ok(struct radeon_if (rdev->flags &RADEON_IS_AGP )return false; +/* Quirks */ +/* HP RS690 only seems to work with MSIs. */ +if ((rdev->pdev->device ==0x791f ) && + (rdev->pdev->subsystem_vendor ==0x103c ) && + (rdev->pdev->subsystem_device ==0x30c2 )) +return true; +if (rdev->flags &RADEON_IS_IGP ) {/* APUs work fine with MSIs */ if (rdev->family >=CHIP_PALM )
PATCH 201/262 drm/radeon: set hpd polarity at init time so hotplug detect works
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jerome Glisse <[email protected]>
commit 8ab250d4484b72ccc78e34276c5ffa84c1d41303 upstream.
Polarity needs to be set accordingly to connector status (connected or disconnected). Set it up at module init so first hotplug works reliably no matter what is the initial set of connector.
--- drivers/gpu/drm/radeon/radeon_connectors.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/radeon/radeon_connectors.c +1 -0
@@ -1779,6 +1779,7 @@ radeon_add_atom_connector(struct drm_dev connector->polled =DRM_CONNECTOR_POLL_CONNECT ; }else connector->polled =DRM_CONNECTOR_POLL_HPD ; +radeon_hpd_set_polarity (rdev, radeon_connector->hpd.hpd); connector->display_info.subpixel_order = subpixel_order;drm_sysfs_connector_add (connector);
PATCH 202/262 drm/radeon/kms: properly set panel mode for eDP
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 00dfb8df5bf8c3afe4c0bb8361133156b06b7a2c upstream.
This should make eDP more reliable.
--- drivers/gpu/drm/radeon/atombios_dp.c | 11 +++++++++++ include/drm/drm_dp_helper.h | 3 +++ 2 files changed, 14 insertions(+)
drivers/gpu/drm/radeon/atombios_dp.c +11 -0
@@ -553,6 +553,7 @@ static void radeon_dp_set_panel_mode(str {struct drm_device *dev = encoder->dev;struct radeon_device *rdev = dev->dev_private; +struct radeon_connector *radeon_connector =to_radeon_connector (connector);int panel_mode =DP_PANEL_MODE_EXTERNAL_DP_MODE ;if (!ASIC_IS_DCE4 (rdev))
@@ -560,10 +561,20 @@ static void radeon_dp_set_panel_mode(strif (radeon_connector_encoder_is_dp_bridge (connector)) panel_mode =DP_PANEL_MODE_INTERNAL_DP1_MODE ; +else if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { +u8 tmp =radeon_read_dpcd_reg (radeon_connector,DP_EDP_CONFIGURATION_CAP ); +if (tmp &1 ) + panel_mode =DP_PANEL_MODE_INTERNAL_DP2_MODE ; + }atombios_dig_encoder_setup (encoder,ATOM_ENCODER_CMD_SETUP_PANEL_MODE , panel_mode); + +if ((connector->connector_type == DRM_MODE_CONNECTOR_eDP) && + (panel_mode ==DP_PANEL_MODE_INTERNAL_DP2_MODE )) { +radeon_write_dpcd_reg (radeon_connector,DP_EDP_CONFIGURATION_SET ,1 ); + } } void radeon_dp_set_link_config(struct drm_connector *connector,
include/drm/drm_dp_helper.h +3 -0
@@ -72,6 +72,7 @@#define DP_MAIN_LINK_CHANNEL_CODING 0x006 +#define DP_EDP_CONFIGURATION_CAP 0x00d#define DP_TRAINING_AUX_RD_INTERVAL 0x00e/* link configuration */
@@ -133,6 +134,8 @@#define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108# define DP_SET_ANSI_8B10B (1 << 0) +#define DP_EDP_CONFIGURATION_SET 0x10a +#define DP_LANE0_1_STATUS 0x202#define DP_LANE2_3_STATUS 0x203# define DP_LANE_CR_DONE (1 << 0)
PATCH 203/262 drm/radeon/kms: Add MSI quirk for Dell RS690
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 01e718ec194e30b3e8eb3858c742c13649757efc upstream.
Some Dell laptops only seem to work with MSIs. This looks like a platform/bios bug.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=37679
--- drivers/gpu/drm/radeon/radeon_irq_kms.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/radeon/radeon_irq_kms.c +6 -0
@@ -125,6 +125,12 @@ static bool radeon_msi_ok(struct radeon_ (rdev->pdev->subsystem_device == 0x30c2))return true; +/* Dell RS690 only seems to work with MSIs. */ +if ((rdev->pdev->device ==0x791f ) && + (rdev->pdev->subsystem_vendor ==0x1028 ) && + (rdev->pdev->subsystem_device ==0x01fd )) +return true; +if (rdev->flags &RADEON_IS_IGP ) {/* APUs work fine with MSIs */ if (rdev->family >=CHIP_PALM )
PATCH 204/262 drm/radeon/kms: add MSI module parameter
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit a18cee15ed4c8b6a35f96b7b26a46bac32e04bd9 upstream.
Allow the user to override whether MSIs are enabled or not on supported ASICs. MSIs are disabled by default on IGP chips as they tend not to work. However certain IGP chips only seem to work with MSIs enabled.
I suspect this is a chipset or bios issue, but I'm not sure what the proper fix is. This will at least make diagnosing and working around the problem much easier.
See:
https://bugs.freedesktop.org/show_bug.cgi?id=37679
--- drivers/gpu/drm/radeon/radeon.h | 1 + drivers/gpu/drm/radeon/radeon_drv.c | 4 ++++ drivers/gpu/drm/radeon/radeon_irq_kms.c | 6 ++++++ 3 files changed, 11 insertions(+)
drivers/gpu/drm/radeon/radeon.h +1 -0
@@ -93,6 +93,7 @@ extern int radeon_audio;extern int radeon_disp_priority;extern int radeon_hw_i2c;extern int radeon_pcie_gen2; +extern int radeon_msi;/* * Copy from radeon_drv.h so we don't have to include both and have conflicting
drivers/gpu/drm/radeon/radeon_drv.c +4 -0
@@ -117,6 +117,7 @@ int radeon_audio = 0;int radeon_disp_priority =0 ;int radeon_hw_i2c =0 ;int radeon_pcie_gen2 =0 ; +int radeon_msi =-1 ;MODULE_PARM_DESC (no_wb,"Disable AGP writeback for scratch registers" );module_param_named (no_wb, radeon_no_wb, int,0444 );
@@ -163,6 +164,9 @@ module_param_named(hw_i2c, radeon_hw_i2cMODULE_PARM_DESC (pcie_gen2,"PCIE Gen2 mode (1 = enable)" );module_param_named (pcie_gen2, radeon_pcie_gen2, int,0444 ); +MODULE_PARM_DESC (msi,"MSI support (1 = enable, 0 = disable, -1 = auto)" ); +module_param_named (msi, radeon_msi, int,0444 ); +static int radeon_suspend (struct drm_device *dev,pm_message_t state) {drm_radeon_private_t *dev_priv = dev->dev_private;
drivers/gpu/drm/radeon/radeon_irq_kms.c +6 -0
@@ -118,6 +118,12 @@ static bool radeon_msi_ok(struct radeon_if (rdev->flags &RADEON_IS_AGP )return false; +/* force MSI on */ +if (radeon_msi ==1 ) +return true; +else if (radeon_msi ==0 ) +return false; +/* Quirks */ /* HP RS690 only seems to work with MSIs. */ if ((rdev->pdev->device == 0x791f) &&
PATCH 205/262 drm/radeon/kms: set HPD polarity in hpd_init()
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 64912e997f0fe13512e4c7b90e4f7c11cb922ab5 upstream.
Polarity needs to be set accordingly to connector status (connected or disconnected). Set it up in hpd_init() so first hotplug works reliably no matter what is the initial set of connector. hpd_init() also covers resume so HPD will work correctly after resume as well.
--- drivers/gpu/drm/radeon/evergreen.c | 1 + drivers/gpu/drm/radeon/r100.c | 1 + drivers/gpu/drm/radeon/r600.c | 19 +++++++++---------- drivers/gpu/drm/radeon/radeon_connectors.c | 1 - drivers/gpu/drm/radeon/rs600.c | 1 + 5 files changed, 12 insertions(+), 11 deletions(-)
drivers/gpu/drm/radeon/evergreen.c +1 -0
@@ -353,6 +353,7 @@ void evergreen_hpd_init(struct radeon_dedefault :break ; } +radeon_hpd_set_polarity (rdev, radeon_connector->hpd.hpd); }if (rdev->irq.installed)evergreen_irq_set (rdev);
drivers/gpu/drm/radeon/r100.c +1 -0
@@ -434,6 +434,7 @@ void r100_hpd_init(struct radeon_devicedefault :break ; } +radeon_hpd_set_polarity (rdev, radeon_connector->hpd.hpd); }if (rdev->irq.installed)r100_irq_set (rdev);
drivers/gpu/drm/radeon/r600.c +9 -10
@@ -762,13 +762,14 @@ void r600_hpd_init(struct radeon_devicestruct drm_device *dev = rdev->ddev;struct drm_connector *connector; -if (ASIC_IS_DCE3 (rdev)) { -u32 tmp =DC_HPDx_CONNECTION_TIMER (0x9c4 ) |DC_HPDx_RX_INT_TIMER (0xfa ); -if (ASIC_IS_DCE32 (rdev)) - tmp |= DC_HPDx_EN; +list_for_each_entry (connector, &dev->mode_config.connector_list, head) { +struct radeon_connector *radeon_connector =to_radeon_connector (connector); + +if (ASIC_IS_DCE3 (rdev)) { +u32 tmp =DC_HPDx_CONNECTION_TIMER (0x9c4 ) |DC_HPDx_RX_INT_TIMER (0xfa ); +if (ASIC_IS_DCE32 (rdev)) + tmp |= DC_HPDx_EN; -list_for_each_entry (connector, &dev->mode_config.connector_list, head) { -struct radeon_connector *radeon_connector =to_radeon_connector (connector);switch (radeon_connector->hpd.hpd) {case RADEON_HPD_1 :WREG32 (DC_HPD1_CONTROL , tmp);
@@ -798,10 +799,7 @@ void r600_hpd_init(struct radeon_devicedefault :break ; } - } - }else { -list_for_each_entry (connector, &dev->mode_config.connector_list, head) { -struct radeon_connector *radeon_connector =to_radeon_connector (connector); + }else {switch (radeon_connector->hpd.hpd) {case RADEON_HPD_1 :WREG32 (DC_HOT_PLUG_DETECT1_CONTROL , DC_HOT_PLUG_DETECTx_EN);
@@ -819,6 +817,7 @@ void r600_hpd_init(struct radeon_devicebreak ; } } +radeon_hpd_set_polarity (rdev, radeon_connector->hpd.hpd); }if (rdev->irq.installed)r600_irq_set (rdev);
drivers/gpu/drm/radeon/radeon_connectors.c +0 -1
@@ -1779,7 +1779,6 @@ radeon_add_atom_connector(struct drm_dev connector->polled =DRM_CONNECTOR_POLL_CONNECT ; }else connector->polled =DRM_CONNECTOR_POLL_HPD ; -radeon_hpd_set_polarity (rdev, radeon_connector->hpd.hpd); connector->display_info.subpixel_order = subpixel_order;drm_sysfs_connector_add (connector);
drivers/gpu/drm/radeon/rs600.c +1 -0
@@ -287,6 +287,7 @@ void rs600_hpd_init(struct radeon_devicedefault :break ; } +radeon_hpd_set_polarity (rdev, radeon_connector->hpd.hpd); }if (rdev->irq.installed)rs600_irq_set (rdev);
PATCH 206/262 kbuild: Fix help text not displayed in choice option.
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Kandagatla <[email protected]>
commit 3f198dfee49d2e9c30583c62b0c79286c78c7b44 upstream.
Help text under choice menu is never displayed because it does not have symbol name associated with it, however many kconfigs have help text under choice, assuming that it will be displayed when user selects help. for example in Kconfig if we have:
choice
prompt "Choice"
---help---
HELP TEXT ...
config A
bool "A"
config B
bool "B"
endchoice
Without this patch "HELP TEXT" is not displayed when user selects help option when "Choice" is highlighted from menuconfig or xconfig or gconfig.
This patch changes the logic in menu_get_ext_help to display help for cases which dont have symbol names like choice.
--- scripts/kconfig/menu.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
scripts/kconfig/menu.c +3 -4
@@ -596,11 +596,10 @@ void menu_get_ext_help(struct menu *menustruct symbol *sym = menu->sym;if (menu_has_help (menu)) { -if (sym->name) { +if (sym->name)str_printf (help,"%s%s:\n\n" ,CONFIG_ , sym->name); -str_append (help,_ (menu_get_help (menu))); -str_append (help,"\n" ); - } +str_append (help,_ (menu_get_help (menu))); +str_append (help,"\n" ); }else {str_append (help, nohelp_text); }
PATCH 207/262 PM / Runtime: Automatically retry failed autosuspends
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 886486b792e4f6f96d4fbe8ec5bf20811cab7d6a upstream.
Originally, the runtime PM core would send an idle notification whenever a suspend attempt failed. The idle callback routine could then schedule a delayed suspend for some time later.
However this behavior was changed by commit f71648d73c1650b8b4aceb3856bebbde6daa3b86 (PM / Runtime: Remove idle notification after failing suspend). No notifications were sent, and there was no clear mechanism to retry failed suspends.
This caused problems for the usbhid driver, because it fails autosuspend attempts as long as a key is being held down. Therefore this patch (as1492) adds a mechanism for retrying failed autosuspends. If the callback routine updates the last_busy field so that the next autosuspend expiration time is in the future, the autosuspend will automatically be rescheduled.
--- Documentation/power/runtime_pm.txt | 10 ++++++++++ drivers/base/power/runtime.c | 18 ++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-)
Documentation/power/runtime_pm.txt +10 -0
@@ -708,6 +708,16 @@ will behave normally, not taking the aut Similarly, if the power.use_autosuspend field isn't set then the autosuspend helper functions will behave just like the non-autosuspend counterparts. +Under some circumstances a driver or subsystem may want to prevent a device +from autosuspending immediately, even though the usage counter is zero and the +autosuspend delay time has expired. If the ->runtime_suspend() callback +returns -EAGAIN or -EBUSY, and if the next autosuspend delay expiration time is +in the future (as it normally would be if the callback invoked +pm_runtime_mark_last_busy()), the PM core will automatically reschedule the +autosuspend. The ->runtime_suspend() callback can't do this rescheduling +itself because no suspend requests of any kind are accepted while the device is +suspending (i.e., while the callback is running). + The implementation is well suited for asynchronous use in interrupt contexts. However such use inevitably involves races, because the PM core can't synchronize ->runtime_suspend() callbacks with the arrival of I/O requests.
drivers/base/power/runtime.c +16 -2
@@ -278,6 +278,9 @@ static int rpm_callback(int (*cb)(struct* If a deferred resume was requested while the callback was running then carry * it out; otherwise send an idle notification for the device (if the suspend * failed) or for its parent (if the suspend succeeded). +* If ->runtime_suspend failed with -EAGAIN or -EBUSY, and if the RPM_AUTO +* flag is set and the next autosuspend-delay expiration time is in the +* future, schedule another autosuspend attempt. * * This function must be called under dev->power.lock with interrupts disabled. */
@@ -389,10 +392,21 @@ static int rpm_suspend(struct device *deif (retval) {__update_runtime_status (dev,RPM_ACTIVE ); dev->power.deferred_resume =0 ; -if (retval == -EAGAIN || retval == -EBUSY ) +if (retval == -EAGAIN || retval == -EBUSY ) { dev->power.runtime_error =0 ; -else + +/* +* If the callback routine failed an autosuspend, and +* if the last_busy time has been updated so that there +* is a new autosuspend expiration time, automatically +* reschedule another autosuspend. +*/ +if ((rpmflags &RPM_AUTO ) && +pm_runtime_autosuspend_expiration (dev) !=0 ) + goto repeat; + }else {pm_runtime_cancel_pending (dev); + } }else { no_callback:__update_runtime_status (dev,RPM_SUSPENDED );
PATCH 208/262 USB: Update last_busy time after autosuspend fails
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit b2c0a863e14676fa5760c6d828fd373288e2f64a upstream.
Originally, the runtime PM core would send an idle notification whenever a suspend attempt failed. The idle callback routine could then schedule a delayed suspend for some time later.
However this behavior was changed by commit f71648d73c1650b8b4aceb3856bebbde6daa3b86 (PM / Runtime: Remove idle notification after failing suspend). No notifications were sent, and there was no clear mechanism to retry failed suspends.
This caused problems for the usbhid driver, because it fails autosuspend attempts as long as a key is being held down. A companion patch changes the PM core's behavior, but we also need to change the USB core. In particular, this patch (as1493) updates the device's last_busy time when an autosuspend fails, so that the PM core will retry the autosuspend in the future when the delay time expires again.
--- drivers/usb/core/driver.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/core/driver.c +5 -0
@@ -1668,6 +1668,11 @@ int usb_runtime_suspend(struct device *dreturn -EAGAIN ; status =usb_suspend_both (udev,PMSG_AUTO_SUSPEND ); + +/* Allow a retry if autosuspend failed temporarily */ +if (status == -EAGAIN || status == -EBUSY ) +usb_mark_last_busy (udev); +/* The PM core reacts badly unless the return code is 0, * -EAGAIN, or -EBUSY, so always return -EBUSY on an error. */
PATCH 209/262 cciss: add small delay when using PCI Power Management to reset for kump
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Miller <[email protected]>
commit ab5dbebe33e0c353e8545f09c34553ac3351dad6 upstream.
The P600 requires a small delay when changing states. Otherwise we may think the board did not reset and we bail. This for kdump only and is particular to the P600.
--- drivers/block/cciss.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/block/cciss.c +7 -0
@@ -4533,6 +4533,13 @@ static int cciss_controller_hard_reset(s pmcsr &= ~PCI_PM_CTRL_STATE_MASK ; pmcsr |=PCI_D0 ;pci_write_config_word (pdev, pos +PCI_PM_CTRL , pmcsr); + +/* +* The P600 requires a small delay when changing states. +* Otherwise we may think the board did not reset and we bail. +* This for kdump only and is particular to the P600. +*/ +msleep (500 ); }return 0 ; }
PATCH 210/262 hwmon: (coretemp) Fix for non-SMP builds
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean Delvare <[email protected]>
commit 2aba6cac2a84f3b80e11a680c34d55e7739b474d upstream.
The definition of TO_ATTR_NO in the non-SMP case is wrong. As the SMP definition resolves to the correct value, just use this for both cases.
Without this fix the temperature attributes are named temp0_* instead of temp2_*, so libsensors won't pick them. Broken since kernel 3.0.
--- drivers/hwmon/coretemp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/hwmon/coretemp.c +1 -2
@@ -50,14 +50,13 @@#ifdef CONFIG_SMP #define TO_PHYS_ID (cpu) cpu_data(cpu).phys_proc_id#define TO_CORE_ID (cpu) cpu_data(cpu).cpu_core_id -#define TO_ATTR_NO (cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)#define for_each_sibling (i, cpu) for_each_cpu(i, cpu_sibling_mask(cpu))#else #define TO_PHYS_ID (cpu) (cpu)#define TO_CORE_ID (cpu) (cpu) -#define TO_ATTR_NO (cpu) (cpu)#define for_each_sibling (i, cpu) for (i = 0; false; )#endif +#define TO_ATTR_NO (cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)/* * Per-Core Temperature Data
PATCH 211/262 hwmon: (w83627ehf) Properly report PECI and AMD-SI sensor types
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean Delvare <[email protected]>
commit 2265cef2751b3441df91f85e0107f9f549e5b711 upstream.
When temperature sources are PECI or AMD-SI agents, it makes no sense to report their type as diode or thermistor. Instead we must report their digital nature.
--- drivers/hwmon/w83627ehf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/hwmon/w83627ehf.c +8 -1
@@ -1756,7 +1756,14 @@ static inline void __devinit w83627ehf_i diode =0x70 ; }for (i =0 ; i <3 ; i++) { -if ((tmp & (0x02 << i))) +const char *label = data->temp_label[data->temp_src[i]]; + +/* Digital source overrides analog type */ +if (strncmp (label,"PECI" ,4 ) ==0 ) + data->temp_type[i] =6 ; +else if (strncmp (label,"AMD" ,3 ) ==0 ) + data->temp_type[i] =5 ; +else if ((tmp & (0x02 << i))) data->temp_type[i] = (diode & (0x10 << i)) ?1 :3 ;else data->temp_type[i] =4 ;/* thermistor */
PATCH 212/262 hwmon: (w83627ehf) Fix broken driver init
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
commit bfa02b0da66965caf46e441270af87edda4fea14 upstream.
Commit 2265cef2 (hwmon: (w83627ehf) Properly report PECI and AMD-SI sensor types) results in kernel panic if data->temp_label was not initialized.
The problem was found with chip W83627DHG-P.
Add check if data->temp->label was set before use.
Based on incomplete patch by Alexander Beregalov.
--- drivers/hwmon/w83627ehf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/hwmon/w83627ehf.c +6 -3
@@ -1756,12 +1756,15 @@ static inline void __devinit w83627ehf_i diode =0x70 ; }for (i =0 ; i <3 ; i++) { -const char *label = data->temp_label[data->temp_src[i]]; +const char *label =NULL ; + +if (data->temp_label) + label = data->temp_label[data->temp_src[i]];/* Digital source overrides analog type */ -if (strncmp (label,"PECI" ,4 ) ==0 ) +if (label &&strncmp (label,"PECI" ,4 ) ==0 ) data->temp_type[i] =6 ; -else if (strncmp (label,"AMD" ,3 ) ==0 ) +else if (label &&strncmp (label,"AMD" ,3 ) ==0 ) data->temp_type[i] =5 ;else if ((tmp & (0x02 << i))) data->temp_type[i] = (diode & (0x10 << i)) ?1 :3 ;
PATCH 213/262 tcm_loop: Add explict read buffer memset for SCF_SCSI_CONTROL_SG_IO_CDB
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <[email protected]>
commit 8cd79f24350826b81e16990d9e12bc878e67d385 upstream.
This patch addresses an issue with buggy userspace code sending I/O via scsi-generic that does not explictly clear their associated read buffers. It adds an explict memset of the first SGL entry within tcm_loop_new_cmd_map() for SCF_SCSI_CONTROL_SG_IO_CDB payloads that are currently guaranteed to be a single SGL by target-core code.
This issue is a side effect of the v3.1-rc1 merge to remove the extra memcpy between certain control CDB types using a contigious
+ cleared buffer in target-core, and performing a memcpy into the SGL list within tcm_loop.
It was originally mainfesting itself by udev + scsi_id + scsi-generic not properly setting up the expected /dev/disk/by-id/ symlinks because the INQUIRY payload was containing extra bogus data preventing the proper NAA IEEE WWN from being parsed by userspace.
--- drivers/target/loopback/tcm_loop.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/target/loopback/tcm_loop.c +18 -0
@@ -127,6 +127,24 @@ static struct se_cmd *tcm_loop_allocate_set_host_byte (sc,DID_NO_CONNECT );return NULL ; } +/* +* Because some userspace code via scsi-generic do not memset their +* associated read buffers, go ahead and do that here for type +* SCF_SCSI_CONTROL_SG_IO_CDB. Also note that this is currently +* guaranteed to be a single SGL for SCF_SCSI_CONTROL_SG_IO_CDB +* by target core in transport_generic_allocate_tasks() -> +* transport_generic_cmd_sequencer(). +*/ +if (se_cmd->se_cmd_flags &SCF_SCSI_CONTROL_SG_IO_CDB && + se_cmd->data_direction ==DMA_FROM_DEVICE ) { +struct scatterlist *sg =scsi_sglist (sc); +unsigned char *buf =kmap (sg_page (sg)) + sg->offset; + +if (buf !=NULL ) { +memset (buf,0 , sg->length); +kunmap (sg_page (sg)); + } + }transport_device_setup_cmd (se_cmd);return se_cmd;
PATCH 214/262 st: fix race in st_scsi_execute_end
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Petr Uzel <[email protected]>
commit c68bf8eeaa57c852e74adcf597237be149eef830 upstream.
The call to complete() in st_scsi_execute_end() wakes up sleeping thread in write_behind_check(), which frees the st_request, thus invalidating the pointer to the associated bio structure, which is then passed to the blk_rq_unmap_user(). Fix by storing pointer to bio structure into temporary local variable.
This bug is present since at least linux-2.6.32.
--- drivers/scsi/st.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/st.c +3 -1
@@ -462,14 +462,16 @@ static void st_scsi_execute_end(struct r {struct st_request *SRpnt = req->end_io_data;struct scsi_tape *STp = SRpnt->stp; +struct bio *tmp; STp->buffer->cmdstat.midlevel_result = SRpnt->result = req->errors; STp->buffer->cmdstat.residual = req->resid_len; + tmp = SRpnt->bio;if (SRpnt->waiting)complete (SRpnt->waiting); -blk_rq_unmap_user (SRpnt->bio); +blk_rq_unmap_user (tmp);__blk_put_request (req->q, req); }
PATCH 215/262 scsi_dh: check queuedata pointer before proceeding further
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Moger, Babu" <[email protected]>
commit a18a920c70d48a8e4a2b750d8a183b3c1a4be514 upstream.
This patch validates sdev pointer in scsi_dh_activate before proceeding further.
Without this check we might see the panic as below. I have seen this panic multiple times..
Call trace:
#0 [ffff88007d647b50] machine_kexec at ffffffff81020902 #1 [ffff88007d647ba0] crash_kexec at ffffffff810875b0 #2 [ffff88007d647c70] oops_end at ffffffff8139c650
#3 [ffff88007d647c90] __bad_area_nosemaphore at ffffffff8102dd15 #4 [ffff88007d647d50] page_fault at ffffffff8139b8cf
[exception RIP: scsi_dh_activate+0x82]
RIP: ffffffffa0041922 RSP: ffff88007d647e00 RFLAGS: 00010046
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00000000000093c5
RDX: 00000000000093c5 RSI: ffffffffa02e6640 RDI: ffff88007cc88988
RBP: 000000000000000f R8: ffff88007d646000 R9: 0000000000000000
R10: ffff880082293790 R11: 00000000ffffffff R12: ffff88007cc88988
R13: 0000000000000000 R14: 0000000000000286 R15: ffff880037b845e0
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0000 #5 [ffff88007d647e38] run_workqueue at ffffffff81060268 #6 [ffff88007d647e78] worker_thread at ffffffff81060386 #7 [ffff88007d647ee8] kthread at ffffffff81064436 #8 [ffff88007d647f48] kernel_thread at ffffffff81003fba
--- drivers/scsi/device_handler/scsi_dh.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/scsi/device_handler/scsi_dh.c +9 -1
@@ -398,7 +398,15 @@ int scsi_dh_activate(struct request_queuspin_lock_irqsave (q->queue_lock, flags); sdev = q->queuedata; -if (sdev && sdev->scsi_dh_data) +if (!sdev) { +spin_unlock_irqrestore (q->queue_lock, flags); + err =SCSI_DH_NOSYS ; +if (fn) +fn (data, err); +return err; + } + +if (sdev->scsi_dh_data) scsi_dh = sdev->scsi_dh_data->scsi_dh; dev =get_device (&sdev->sdev_gendev); if (!scsi_dh || !dev ||
PATCH 216/262 Make scsi_free_queue() kill pending SCSI commands
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit 3308511c93e6ad0d3c58984ecd6e5e57f96b12c8 upstream.
Make sure that SCSI device removal via scsi_remove_host() does finish all pending SCSI commands. Currently that's not the case and hence removal of a SCSI host during I/O can cause a deadlock. See also "blkdev_issue_discard() hangs forever if underlying storage device is removed" (http://bugzilla.kernel.org/show_bug.cgi?id=40472). See also
http://lkml.org/lkml/2011/8/27/6.
--- drivers/scsi/hosts.c | 9 ++++++--- drivers/scsi/scsi_lib.c | 9 +++++++++ 2 files changed, 15 insertions(+), 3 deletions(-)
drivers/scsi/hosts.c +6 -3
@@ -286,6 +286,7 @@ static void scsi_host_dev_release(struct {struct Scsi_Host *shost =dev_to_shost (dev);struct device *parent = dev->parent; +struct request_queue *q;scsi_proc_hostdir_rm (shost->hostt);
@@ -293,9 +294,11 @@ static void scsi_host_dev_release(structkthread_stop (shost->ehandler);if (shost->work_q)destroy_workqueue (shost->work_q); -if (shost->uspace_req_q) { -kfree (shost->uspace_req_q->queuedata); -scsi_free_queue (shost->uspace_req_q); + q = shost->uspace_req_q; +if (q) { +kfree (q->queuedata); + q->queuedata =NULL ; +scsi_free_queue (q); }scsi_destroy_command_freelist (shost);
drivers/scsi/scsi_lib.c +9 -0
@@ -1697,6 +1697,15 @@ struct request_queue *scsi_alloc_queue(svoid scsi_free_queue (struct request_queue *q) { +unsigned long flags; + +WARN_ON (q->queuedata); + +/* cause scsi_request_fn() to kill all non-finished requests */ +spin_lock_irqsave (q->queue_lock, flags); + q->request_fn (q); +spin_unlock_irqrestore (q->queue_lock, flags); +blk_cleanup_queue (q); }
PATCH 217/262 Fix block queue and elevator memory leak in scsi_alloc_sdev
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit f7c9c6bb14f3104608a3a83cadea10a6943d2804 upstream.
When looking at memory consumption issues I noticed quite a lot of memory in the kmalloc-2048 bucket:
OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
6561 6471 98% 2.30K 243 27 15552K kmalloc-2048
Over 15MB. slub debug shows that cfq is responsible for almost all of it:
# sort -nr /sys/kernel/slab/kmalloc-2048/alloc_calls 6402 .cfq_init_queue+0xec/0x460 age=43423/43564/43655 pid=1 cpus=4,11,13
In scsi_alloc_sdev we do scsi_alloc_queue but if slave_alloc fails we don't free it with scsi_free_queue.
The patch below fixes the issue:
OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME
135 72 53% 2.30K 5 27 320K kmalloc-2048
# cat /sys/kernel/slab/kmalloc-2048/alloc_calls 3 .cfq_init_queue+0xec/0x460 age=3811/3876/3925 pid=1 cpus=4,11,13
--- drivers/scsi/scsi_scan.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/scsi_scan.c +1 -0
@@ -322,6 +322,7 @@ out_device_destroy:scsi_device_set_state (sdev,SDEV_DEL );transport_destroy_device (&sdev->sdev_gendev);put_device (&sdev->sdev_dev); +scsi_free_queue (sdev->request_queue);put_device (&sdev->sdev_gendev); out:if (display_failure_msg)
PATCH 218/262 mpt2sas: Fix for system hang when discovery in progress
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "[email protected]" <[email protected]>
commit 0167ac67ff6f35bf2364f7672c8012b0cd40277f upstream.
Fix for issue : While discovery is in progress, hot unplug and hot plug of enclosure connected to the controller card is causing system to hang.
When a device is in the process of being detected at driver load time then if it is removed, the device that is no longer present will not be added to the list. So the code in _scsih_probe_sas() is rearranged as such so the devices that failed to be detected are not added to the list.
--- drivers/scsi/mpt2sas/mpt2sas_scsih.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/scsi/mpt2sas/mpt2sas_scsih.c +10 -5
@@ -7318,22 +7318,27 @@ _scsih_probe_sas(struct MPT2SAS_ADAPTER/* SAS Device List */ list_for_each_entry_safe (sas_device, next, &ioc->sas_device_init_list, list) { -spin_lock_irqsave (&ioc->sas_device_lock, flags); -list_move_tail (&sas_device->list, &ioc->sas_device_list); -spin_unlock_irqrestore (&ioc->sas_device_lock, flags);if (ioc->hide_drives)continue ;if (!mpt2sas_transport_port_add (ioc, sas_device->handle, sas_device->sas_address_parent)) { -_scsih_sas_device_remove (ioc, sas_device); +list_del (&sas_device->list); +kfree (sas_device); +continue ; }else if (!sas_device->starget) {mpt2sas_transport_port_remove (ioc, sas_device->sas_address, sas_device->sas_address_parent); -_scsih_sas_device_remove (ioc, sas_device); +list_del (&sas_device->list); +kfree (sas_device); +continue ; + } +spin_lock_irqsave (&ioc->sas_device_lock, flags); +list_move_tail (&sas_device->list, &ioc->sas_device_list); +spin_unlock_irqrestore (&ioc->sas_device_lock, flags); } }
PATCH 219/262 ASoC: wm8711: Fix wrong mask for setting input audio data bit length select
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Axel Lin <[email protected]>
commit 04c57163c8edfbc50e022737014069998ba4fc5f upstream.
The Input Audio Data Bit Length Select is controlled by BIT[3:2] of WM8711_IFACE(07h) register.
Current code incorrectly masks BIT[1:0] which is for Audio Data Format Select.
--- sound/soc/codecs/wm8711.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm8711.c +1 -1
@@ -150,7 +150,7 @@ static int wm8711_hw_params(struct snd_p {struct snd_soc_codec *codec = dai->codec;struct wm8711_priv *wm8711 =snd_soc_codec_get_drvdata (codec); -u16 iface =snd_soc_read (codec,WM8711_IFACE ) &0xfffc ; +u16 iface =snd_soc_read (codec,WM8711_IFACE ) &0xfff3 ;int i =get_coeff (wm8711->sysclk,params_rate (params));u16 srate = (coeff_div[i].sr <<2 ) | (coeff_div[i].bosr <<1 ) | coeff_div[i].usb;
PATCH 220/262 ASoC: Leave input audio data bit length settings untouched in wm8711_set_dai_fmt
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Axel Lin <[email protected]>
commit d558cfc30064a97c2c65dbd2b3a4f5a1dea7ec1b upstream.
Current implementation in wm8711_set_dai_fmt always clear BIT[3:2] (the Input Audio Data Bit Length Select) of WM8711_IFACE(07h) register. Input Audio Data Bit Length Select bits are set by wm8711_hw_params, we should leave BIT[3:2] untouched in wm8711_set_dai_fmt.
--- sound/soc/codecs/wm8711.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm8711.c +1 -1
@@ -231,7 +231,7 @@ static int wm8711_set_dai_fmt(struct snd unsigned int fmt) {struct snd_soc_codec *codec = codec_dai->codec; -u16 iface =0 ; +u16 iface =snd_soc_read (codec,WM8711_IFACE ) &0x000c ;/* set master/slave audio interface */ switch (fmt &SND_SOC_DAIFMT_MASTER_MASK ) {
PATCH 221/262 ASoC: WM8904: Set `invert bit for Capture Switch
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hong Xu <[email protected]>
commit 5a7c5f26df3c0122814dfa1c13ef6dfbdbffdb86 upstream.
Set `invert' bit for Capture Switch. Otherwise analogue is muted when Capture Switch is ON.
--- sound/soc/codecs/wm8904.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm8904.c +1 -1
@@ -868,7 +868,7 @@ SOC_ENUM("Right Capture Mode", rin_mode)SOC_DOUBLE_R ("Capture Volume" ,WM8904_ANALOGUE_LEFT_INPUT_0 ,WM8904_ANALOGUE_RIGHT_INPUT_0 ,0 ,31 ,0 ),SOC_DOUBLE_R ("Capture Switch" ,WM8904_ANALOGUE_LEFT_INPUT_0 , -WM8904_ANALOGUE_RIGHT_INPUT_0 ,7 ,1 ,0 ), +WM8904_ANALOGUE_RIGHT_INPUT_0 ,7 ,1 ,1 ),SOC_SINGLE ("High Pass Filter Switch" ,WM8904_ADC_DIGITAL_0 ,4 ,1 ,0 ), SOC_ENUM("High Pass Filter Mode", hpf_mode),
PATCH 222/262 ASoC: Ensure WM8962 PLL registers are reset
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit 4f4488abc97c1c27ff029f887944e6a6da1f5733 upstream.
The WM8962 has a separate software reset for the PLL registers. Ensure that these are reset also on startup.
--- sound/soc/codecs/wm8962.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
sound/soc/codecs/wm8962.c +7 -1
@@ -1957,7 +1957,13 @@ static int wm8962_readable_register(strustatic int wm8962_reset (struct snd_soc_codec *codec) { -return snd_soc_write (codec,WM8962_SOFTWARE_RESET ,0x6243 ); +int ret; + + ret =snd_soc_write (codec,WM8962_SOFTWARE_RESET ,0x6243 ); +if (ret !=0 ) +return ret; + +return snd_soc_write (codec,WM8962_PLL_SOFTWARE_RESET ,0 ); } static const DECLARE_TLV_DB_SCALE(inpga_tlv, -2325, 75, 0);
PATCH 223/262 ASoC: Ensure the WM8962 oscillator and PLLs start up disabled
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit 2af8de8c39cf58e5a5e40a9d5d71332da98e6ba7 upstream.
Since there is no current software control for these they would otherwise be left enabled, consuming power.
--- sound/soc/codecs/wm8962.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/soc/codecs/wm8962.c +5 -0
@@ -3829,6 +3829,11 @@ static int wm8962_probe(struct snd_soc_c*/ snd_soc_update_bits (codec,WM8962_CLOCKING2 ,WM8962_SYSCLK_ENA ,0 ); +/* Ensure that the oscillator and PLLs are disabled */ +snd_soc_update_bits (codec,WM8962_PLL2 , +WM8962_OSC_ENA |WM8962_PLL2_ENA |WM8962_PLL3_ENA , +0 ); +regulator_bulk_disable (ARRAY_SIZE (wm8962->supplies), wm8962->supplies);if (pdata) {
PATCH 224/262 NFS/sunrpc: dont use a credential with extra groups.
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit dc6f55e9f8dac4b6479be67c5c9128ad37bb491f upstream.
The sunrpc layer keeps a cache of recently used credentials and 'unx_match' is used to find the credential which matches the current process.
However unx_match allows a match when the cached credential has extra groups at the end of uc_gids list which are not in the process group list.
So if a process with a list of (say) 4 group accesses a file and gains access because of the last group in the list, then another process with the same uid and gid, and a gid list being the first tree of the gids of the original process tries to access the file, it will be granted access even though it shouldn't as the wrong rpc credential will be used.
--- net/sunrpc/auth_unix.c | 3 +++ 1 file changed, 3 insertions(+)
net/sunrpc/auth_unix.c +3 -0
@@ -129,6 +129,9 @@ unx_match(struct auth_cred *acred, strucfor (i =0 ; i < groups ; i++)if (cred->uc_gids[i] !=GROUP_AT (acred->group_info, i))return 0 ; +if (groups <NFS_NGROUPS && + cred->uc_gids[groups] !=NOGROUP ) +return 0 ;return 1 ; }
PATCH 225/262 block: make gendisk hold a reference to its queue
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit f992ae801a7dec34a4ed99a6598bbbbfb82af4fb upstream.
The following command sequence triggers an oops.
# mount /dev/sdb1 /mnt # echo 1 > /sys/class/scsi_device/0\:0\:1\:0/device/delete # umount /mnt
general protection fault: 0000 [#1] PREEMPT SMP CPU 2 Modules linked in:
Pid: 791, comm: umount Not tainted 3.1.0-rc3-work+ #8 Bochs Bochs
RIP: 0010:[<ffffffff810d0879>] [<ffffffff810d0879>] __lock_acquire+0x389/0x1d60 ... Call Trace: [<ffffffff810d2845>] lock_acquire+0x95/0x140 [<ffffffff81aed87b>] _raw_spin_lock+0x3b/0x50 [<ffffffff811573bc>] bdi_lock_two+0x5c/0x70 [<ffffffff811c2f6c>] bdev_inode_switch_bdi+0x4c/0xf0 [<ffffffff811c3fcb>] __blkdev_put+0x11b/0x1d0 [<ffffffff811c4010>] __blkdev_put+0x160/0x1d0 [<ffffffff811c40df>] blkdev_put+0x5f/0x190 [<ffffffff8118f18d>] kill_block_super+0x4d/0x80 [<ffffffff8118f4a5>] deactivate_locked_super+0x45/0x70 [<ffffffff8119003a>] deactivate_super+0x4a/0x70 [<ffffffff811ac4ad>] mntput_no_expire+0xed/0x130 [<ffffffff811acf2e>] sys_umount+0x7e/0x3a0 [<ffffffff81aeeeab>] system_call_fastpath+0x16/0x1b
This is because bdev holds on to disk but disk doesn't pin the associated queue. If a SCSI device is removed while the device is still open, the sdev puts the base reference to the queue on release. When the bdev is finally released, the associated queue is already gone along with the bdi and bdev_inode_switch_bdi() ends up dereferencing already freed bdi.
Even if it were not for this bug, disk not holding onto the associated queue is very unusual and error-prone.
Fix it by making add_disk() take an extra reference to its queue and put it on disk_release() and ensuring that disk and its fops owner are put in that order after all accesses to the disk and queue are complete.
--- block/genhd.c | 8 ++++++++ fs/block_dev.c | 13 ++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-)
block/genhd.c +8 -0
@@ -611,6 +611,12 @@ void add_disk(struct gendisk *disk)register_disk (disk);blk_register_queue (disk); +/* +* Take an extra ref on queue which will be put on disk_release() +* so that it sticks around as long as @disk is there. +*/ +WARN_ON_ONCE (blk_get_queue (disk->queue)); + retval =sysfs_create_link (&disk_to_dev (disk)->kobj, &bdi->dev->kobj,"bdi" );WARN_ON (retval);
@@ -1103,6 +1109,8 @@ static void disk_release(struct device *disk_replace_part_tbl (disk,NULL );free_part_stats (&disk->part0);free_part_info (&disk->part0); +if (disk->queue) +blk_put_queue (disk->queue);kfree (disk); }struct class block_class = {
fs/block_dev.c +8 -5
@@ -1075,6 +1075,7 @@ static int __blkdev_put(struct block_devstatic int __blkdev_get (struct block_device *bdev,fmode_t mode,int for_part) {struct gendisk *disk; +struct module *owner;int ret;int partno;int perm =0 ;
@@ -1100,6 +1101,7 @@ static int __blkdev_get(struct block_dev disk =get_gendisk (bdev->bd_dev, &partno);if (!disk) goto out; + owner = disk->fops->owner;disk_block_events (disk);mutex_lock_nested (&bdev->bd_mutex, for_part);
@@ -1127,8 +1129,8 @@ static int __blkdev_get(struct block_dev bdev->bd_disk =NULL ;mutex_unlock (&bdev->bd_mutex);disk_unblock_events (disk); -module_put (disk->fops->owner);put_disk (disk); +module_put (owner); goto restart; } }
@@ -1184,8 +1186,8 @@ static int __blkdev_get(struct block_dev goto out_unlock_bdev; }/* only one opener holds refs to the module and disk */ -module_put (disk->fops->owner);put_disk (disk); +module_put (owner); } bdev->bd_openers++;if (for_part)
@@ -1205,8 +1207,8 @@ static int __blkdev_get(struct block_dev out_unlock_bdev:mutex_unlock (&bdev->bd_mutex);disk_unblock_events (disk); -module_put (disk->fops->owner);put_disk (disk); +module_put (owner); out:bdput (bdev);
@@ -1432,14 +1434,15 @@ static int __blkdev_put(struct block_devif (!bdev->bd_openers) {struct module *owner = disk->fops->owner; -put_disk (disk); -module_put (owner);disk_put_part (bdev->bd_part); bdev->bd_part =NULL ; bdev->bd_disk =NULL ;if (bdev != bdev->bd_contains) victim = bdev->bd_contains; bdev->bd_contains =NULL ; + +put_disk (disk); +module_put (owner); }mutex_unlock (&bdev->bd_mutex);bdput (bdev);
PATCH 226/262 xen/blkback: Report VBD_WSECT (wr_sect) properly.
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Rzeszutek Wilk <[email protected]>
commit 5c62cb48602dba95159c81ffeca179d3852e25be upstream.
We did not increment the amount of sectors written to disk b/c we tested for the == WRITE which is incorrect - as the operations are more of WRITE_FLUSH, WRITE_ODIRECT. This patch fixes it by doing a & WRITE check.
--- drivers/block/xen-blkback/blkback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/xen-blkback/blkback.c +1 -1
@@ -667,7 +667,7 @@ static int dispatch_rw_block_io(struct xif (operation ==READ ) blkif->st_rd_sect += preq.nr_sects; -else if (operation ==WRITE || operation ==WRITE_FLUSH ) +else if (operation &WRITE ) blkif->st_wr_sect += preq.nr_sects;return 0 ;
PATCH 227/262 VFS: fix statfs() automounter semantics regression
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan McGee <[email protected]>
commit 5c8a0fbba543d9428a486f0d1282bbcf3cf1d95a upstream.
No one in their right mind would expect statfs() to not work on a automounter managed mount point. Fix it.
[ I'm not sure about the "no one in their right mind" part. It's not
mounted, and you didn't ask for it to be mounted. But nobody will really care, and this probably makes it match previous semantics, so..
- Linus ]
This mirrors the fix made to the quota code in 815d405ceff0d69646.
--- fs/statfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/statfs.c +1 -1
@@ -76,7 +76,7 @@ EXPORT_SYMBOL(vfs_statfs);int user_statfs (const char __user *pathname,struct kstatfs *st) {struct path path; -int error =user_path (pathname, &path); +int error =user_path_at (AT_FDCWD , pathname,LOOKUP_FOLLOW |LOOKUP_AUTOMOUNT , &path);if (!error) { error =vfs_statfs (&path, st);path_put (&path);
PATCH 228/262 hpsa: add small delay when using PCI Power Management to reset for kump
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Miller <[email protected]>
commit c4853efec665134b2e6fc9c13447323240980351 upstream.
The P600 requires a small delay when changing states. Otherwise we may think the board did not reset and we bail. This for kdump only and is particular to the P600.
--- drivers/scsi/hpsa.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/scsi/hpsa.c +7 -0
@@ -3300,6 +3300,13 @@ static int hpsa_controller_hard_reset(st pmcsr &= ~PCI_PM_CTRL_STATE_MASK ; pmcsr |=PCI_D0 ;pci_write_config_word (pdev, pos +PCI_PM_CTRL , pmcsr); + +/* +* The P600 requires a small delay when changing states. +* Otherwise we may think the board did not reset and we bail. +* This for kdump only and is particular to the P600. +*/ +msleep (500 ); }return 0 ; }
PATCH 229/262 VFS: we need to set LOOKUP_JUMPED on mountpoint crossing
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
commit a3fbbde70a0cec017f2431e8f8de208708c76acc upstream.
Mountpoint crossing is similar to following procfs symlinks - we do not get ->d_revalidate() called for dentry we have arrived at, with unpleasant consequences for NFS4.
Simple way to reproduce the problem in mainline:
cat >/tmp/a.c <<'EOF'
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
main()
{
struct flock fl = {.l_type = F_RDLCK, .l_whence = SEEK_SET, .l_len = 1};
if (fcntl(0, F_SETLK, &fl))
perror("setlk");
}
EOF
cc /tmp/a.c -o /tmp/testthen on nfs4:
mount --bind file1 file2
/tmp/test < file1 # ok
/tmp/test < file2 # spews "setlk: No locks available"...What happens is the missing call of ->d_revalidate() after mountpoint crossing and that's where NFS4 would issue OPEN request to server.
The fix is simple - treat mountpoint crossing the same way we deal with following procfs-style symlinks. I.e. set LOOKUP_JUMPED...
--- fs/namei.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
fs/namei.c +15 -1
@@ -910,7 +910,7 @@ static int follow_managed(struct path *pmntput (path->mnt);if (ret == -EISDIR ) ret =0 ; -return ret; +return ret <0 ? ret : need_mntput; }int follow_down_one (struct path *path)
@@ -958,6 +958,7 @@ static bool __follow_mount_rcu(struct nabreak ; path->mnt = mounted; path->dentry = mounted->mnt_root; + nd->flags |=LOOKUP_JUMPED ; nd->seq =read_seqcount_begin (&path->dentry->d_seq);/* * Update the inode too. We don't need to re-check the
@@ -1232,6 +1233,8 @@ retry:path_put_conditional (path, nd);return err; } +if (err) + nd->flags |=LOOKUP_JUMPED ; *inode = path->dentry->d_inode;return 0 ; }
@@ -2118,6 +2121,10 @@ static struct file *do_last(struct namei }/* create side of things */ +/* +* This will *only* deal with leaving RCU mode - LOOKUP_JUMPED has been +* cleared when we got to the last component we are about to look up +*/ error =complete_walk (nd);if (error)return ERR_PTR (error);
@@ -2186,6 +2193,9 @@ static struct file *do_last(struct nameiif (error <0 ) goto exit_dput; +if (error) + nd->flags |=LOOKUP_JUMPED ; + error = -ENOENT ;if (!path->dentry->d_inode) goto exit_dput;
@@ -2195,6 +2205,10 @@ static struct file *do_last(struct nameipath_to_nameidata (path, nd); nd->inode = path->dentry->d_inode; +/* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */ + error =complete_walk (nd); +if (error) + goto exit; error = -EISDIR ;if (S_ISDIR (nd->inode->i_mode)) goto exit;
PATCH 230/262 powerpc/numa: Remove double of_node_put in hot_add_node_scn_to_nid
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit 6083184269fd723affca4f6340e491950267622a upstream.
During memory hotplug testing, I got the following warning:
ERROR: Bad of_node_put() on /memory@0
of_node_releasekref_putof_node_putof_find_node_by_typehot_add_node_scn_to_nidhot_add_scn_to_nidmemory_add_physaddr_to_nid
...
of_find_node_by_type() loop does the of_node_put for us so we only need the handle the case where we terminate the loop early.
As suggested by Stephen Rothwell we can do the of_node_put unconditionally outside of the loop since of_node_put handles a NULL argument fine.
--- arch/powerpc/mm/numa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/mm/numa.c +2 -1
@@ -1214,11 +1214,12 @@ int hot_add_node_scn_to_nid(unsigned lonbreak ; } -of_node_put (memory);if (nid >=0 )break ; } +of_node_put (memory); +return nid; }
PATCH 231/262 powerpc: Fix oops when echoing bad values to /sys/devices/system/memory/probe
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit a11940978bd598e65996b4f807cf4904793f7025 upstream.
If we echo an address the hypervisor doesn't like to /sys/devices/system/memory/probe we oops the box:
# echo 0x10000000000 > /sys/devices/system/memory/probe
kernel BUG at arch/powerpc/mm/hash_utils_64.c:541!
The backtrace is:
create_section_mappingarch_add_memoryadd_memorymemory_probe_storesysdev_class_storesysfs_write_filevfs_writeSyS_write
In create_section_mapping we BUG if htab_bolt_mapping returned an error. A better approach is to return an error which will propagate back to userspace.
Rerunning the test with this patch applied:
# echo 0x10000000000 > /sys/devices/system/memory/probe -bash: echo: write error: Invalid argument
--- arch/powerpc/include/asm/sparsemem.h | 2 +- arch/powerpc/mm/hash_utils_64.c | 6 +++--- arch/powerpc/mm/mem.c | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-)
arch/powerpc/include/asm/sparsemem.h +1 -1
@@ -16,7 +16,7 @@#endif /* CONFIG_SPARSEMEM */ #ifdef CONFIG_MEMORY_HOTPLUG -extern void create_section_mapping (unsigned long start,unsigned long end); +extern int create_section_mapping (unsigned long start,unsigned long end);extern int remove_section_mapping (unsigned long start,unsigned long end);#ifdef CONFIG_NUMA extern int hot_add_scn_to_nid (unsigned long scn_addr);
arch/powerpc/mm/hash_utils_64.c +3 -3
@@ -534,11 +534,11 @@ static unsigned long __init htab_get_tab }#ifdef CONFIG_MEMORY_HOTPLUG -void create_section_mapping (unsigned long start,unsigned long end) +int create_section_mapping (unsigned long start,unsigned long end) { -BUG_ON (htab_bolt_mapping (start, end,__pa (start), +return htab_bolt_mapping (start, end,__pa (start),pgprot_val (PAGE_KERNEL ), mmu_linear_psize, - mmu_kernel_ssize)); + mmu_kernel_ssize); }int remove_section_mapping (unsigned long start,unsigned long end)
arch/powerpc/mm/mem.c +2 -1
@@ -123,7 +123,8 @@ int arch_add_memory(int nid, u64 start, pgdata =NODE_DATA (nid); start = (unsigned long )__va (start); -create_section_mapping (start, start + size); +if (create_section_mapping (start, start + size)) +return -EINVAL ;/* this should work for most non-highmem platforms */ zone = pgdata->node_zones;
PATCH 232/262 powerpc/pseries: Avoid spurious error during hotplug CPU add
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit 9c740025c51a26ab00192cfc464064d4ccbfe3fc upstream.
During hotplug CPU add we get the following error:
Unexpected Error (0) returned from configure-connector
ibm,configure-connector returns 0 for configuration complete, so catch this and avoid the error.
--- arch/powerpc/platforms/pseries/dlpar.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/powerpc/platforms/pseries/dlpar.c +4 -0
@@ -112,6 +112,7 @@ void dlpar_free_cc_nodes(struct device_ndlpar_free_one_cc_node (dn); } +#define COMPLETE 0#define NEXT_SIBLING 1#define NEXT_CHILD 2#define NEXT_PROPERTY 3
@@ -158,6 +159,9 @@ struct device_node *dlpar_configure_connspin_unlock (&rtas_data_buf_lock);switch (rc) { +case COMPLETE : +break ; +case NEXT_SIBLING : dn =dlpar_parse_cc_node (ccwa);if (!dn)
PATCH 233/262 powerpc/eeh: Fix /proc/ppc64/eeh creation
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thadeu Lima de Souza Cascardo <[email protected]>
commit 8feaa43494cee5e938fd5a57b9e9bf1c827e6ccd upstream.
Since commit 188917e183cf9ad0374b571006d0fc6d48a7f447, /proc/ppc64 is a symlink to /proc/powerpc/. That means that creating /proc/ppc64/eeh will end up with a unaccessible file, that is not listed under /proc/powerpc/ and, then, not listed under /proc/ppc64/.
Creating /proc/powerpc/eeh fixes that problem and maintain the compatibility intended with the ppc64 symlink.
--- arch/powerpc/platforms/pseries/eeh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/pseries/eeh.c +1 -1
@@ -1338,7 +1338,7 @@ static const struct file_operations procstatic int __init eeh_init_proc (void ) {if (machine_is (pseries)) -proc_create ("ppc64/eeh" ,0 ,NULL , &proc_eeh_operations); +proc_create ("powerpc/eeh" ,0 ,NULL , &proc_eeh_operations);return 0 ; }__initcall (eeh_init_proc);
PATCH 234/262 powerpc: Fix deadlock in icswx code
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anton Blanchard <[email protected]>
commit 8bdafa39a47265bc029838b35cc6585f69224afa upstream.
The icswx code introduced an A-B B-A deadlock:
CPU0 CPU1
---- ----
lock(&anon_vma->mutex);
lock(&mm->mmap_sem);
lock(&anon_vma->mutex);lock(&mm->mmap_sem);
Instead of using the mmap_sem to keep mm_users constant, take the page table spinlock.
--- arch/powerpc/mm/mmu_context_hash64.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/powerpc/mm/mmu_context_hash64.c +6 -6
@@ -136,8 +136,8 @@ int use_cop(unsigned long acop, struct mif (!mm || !acop)return -EINVAL ; -/* We need to make sure mm_users doesn't change */ -down_read (&mm->mmap_sem); +/* The page_table_lock ensures mm_users won't change under us */ +spin_lock (&mm->page_table_lock);spin_lock (mm->context.cop_lockp);if (mm->context.cop_pid ==COP_PID_NONE ) {
@@ -164,7 +164,7 @@ int use_cop(unsigned long acop, struct m out:spin_unlock (mm->context.cop_lockp); -up_read (&mm->mmap_sem); +spin_unlock (&mm->page_table_lock);return ret; }
@@ -185,8 +185,8 @@ void drop_cop(unsigned long acop, structif (WARN_ON_ONCE (!mm))return ; -/* We need to make sure mm_users doesn't change */ -down_read (&mm->mmap_sem); +/* The page_table_lock ensures mm_users won't change under us */ +spin_lock (&mm->page_table_lock);spin_lock (mm->context.cop_lockp); mm->context.acop &= ~acop;
@@ -213,7 +213,7 @@ void drop_cop(unsigned long acop, struct }spin_unlock (mm->context.cop_lockp); -up_read (&mm->mmap_sem); +spin_unlock (&mm->page_table_lock); }EXPORT_SYMBOL_GPL (drop_cop);
PATCH 235/262 ACPI atomicio: Convert width in bits to bytes in __acpi_ioremap_fast()
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Luck, Tony" <[email protected]>
commit 3bf3f8b19d2bfccc40f13c456bf339fd8f535ebc upstream.
Callers to __acpi_ioremap_fast() pass the bit_width that they found in the acpi_generic_address structure. Convert from bits to bytes when passing to __acpi_find_iomap() - as it wants to see bytes, not bits.
--- drivers/acpi/atomicio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/atomicio.c +1 -1
@@ -76,7 +76,7 @@ static void __iomem *__acpi_ioremap_fast {struct acpi_iomap *map; - map =__acpi_find_iomap (paddr, size); + map =__acpi_find_iomap (paddr, size/8 );if (map)return map->vaddr + (paddr - map->paddr);else
PATCH 236/262 netlink: validate NLA_MSECS length
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit c30bc94758ae2a38a5eb31767c1985c0aae0950b upstream.
L2TP for example uses NLA_MSECS like this:
policy:
[L2TP_ATTR_RECV_TIMEOUT] = { .type = NLA_MSECS, },
code:
if (info->attrs[L2TP_ATTR_RECV_TIMEOUT])
cfg.reorder_timeout = nla_get_msecs(info->attrs[L2TP_ATTR_RECV_TIMEOUT]);As nla_get_msecs() is essentially nla_get_u64() plus the conversion to a HZ-based value, this will not properly reject attributes from userspace that aren't long enough and might overrun the message.
Add NLA_MSECS to the attribute minlen array to check the size properly.
--- lib/nlattr.c | 1 + 1 file changed, 1 insertion(+)
lib/nlattr.c +1 -0
@@ -20,6 +20,7 @@ static const u16 nla_attr_minlen[NLA_TYP [NLA_U16] = sizeof(u16), [NLA_U32] = sizeof(u32), [NLA_U64] = sizeof(u64), + [NLA_MSECS] = sizeof(u64), [NLA_NESTED] = NLA_HDRLEN, };
PATCH 237/262 ath9k_hw: Update AR9485 initvals to fix system hang issue
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rajkumar Manoharan <[email protected]>
commit 98fb2cc115b4ef1ea0a2d87a170c183bd395dd6c upstream.
This patch fixes system hang when resuming from S3 state and lower rate sens failure issue.
--- drivers/net/wireless/ath/ath9k/ar9485_initvals.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath9k/ar9485_initvals.h +5 -5
@@ -521,7 +521,7 @@ static const u32 ar9485_1_1_radio_postam {0x000160ac, 0x24611800}, {0x000160b0, 0x03284f3e}, {0x0001610c, 0x00170000}, - {0x00016140, 0x10804008}, + {0x00016140, 0x50804008}, }; static const u32 ar9485_1_1_mac_postamble[][5] = {
@@ -603,7 +603,7 @@ static const u32 ar9485_1_1_radio_core[]static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_enable_L1[][2 ] = {/* Addr allmodes */ - {0x00018c00 ,0x10052e5e }, + {0x00018c00 ,0x18052e5e }, {0x00018c04 ,0x000801d8 }, {0x00018c08 ,0x0000080c }, };
@@ -776,7 +776,7 @@ static const u32 ar9485_modes_green_ob_dstatic const u32 ar9485_1_1_pcie_phy_clkreq_disable_L1[][2 ] = {/* Addr allmodes */ - {0x00018c00 ,0x10013e5e }, + {0x00018c00 ,0x18013e5e }, {0x00018c04 ,0x000801d8 }, {0x00018c08 ,0x0000080c }, };
@@ -882,7 +882,7 @@ static const u32 ar9485_fast_clock_1_1_bstatic const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_disable_L1[][2 ] = {/* Addr allmodes */ - {0x00018c00 ,0x10012e5e }, + {0x00018c00 ,0x18012e5e }, {0x00018c04 ,0x000801d8 }, {0x00018c08 ,0x0000080c }, };
@@ -1021,7 +1021,7 @@ static const u32 ar9485_common_rx_gain_1static const u32 ar9485_1_1_pcie_phy_clkreq_enable_L1[][2 ] = {/* Addr allmodes */ - {0x00018c00 ,0x10053e5e }, + {0x00018c00 ,0x18053e5e }, {0x00018c04 ,0x000801d8 }, {0x00018c08 ,0x0000080c }, };
PATCH 238/262 mac80211: fix remain_off_channel regression
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eliad Peller <[email protected]>
commit eaa7af2ae582c9a8c51b374c48d5970b748a5ce2 upstream.
The offchannel code is currently broken - we should remain_off_channel if the work was started, and the work's channel and channel_type are the same as local->tmp_channel and local->tmp_channel_type.
However, if wk->chan_type and local->tmp_channel_type coexist (e.g. have the same channel type), we won't remain_off_channel.
This behavior was introduced by commit da2fd1f ("mac80211: Allow work items to use existing channel type.")
--- net/mac80211/work.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/mac80211/work.c +2 -2
@@ -1060,8 +1060,8 @@ static void ieee80211_work_work(struct wcontinue ;if (wk->chan != local->tmp_channel)continue ; -if (ieee80211_work_ct_coexists (wk->chan_type, - local->tmp_channel_type)) +if (!ieee80211_work_ct_coexists (wk->chan_type, + local->tmp_channel_type))continue ; remain_off_channel = true; }
PATCH 239/262 mac80211: config hw when going back on-channel
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eliad Peller <[email protected]>
commit 6911bf0453e0d6ea8eb694a4ce67a68d071c538e upstream.
When going back on-channel, we should reconfigure the hw iff the hardware is not already configured to the operational channel.
--- net/mac80211/work.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/mac80211/work.c +1 -2
@@ -1067,7 +1067,6 @@ static void ieee80211_work_work(struct w }if (!remain_off_channel && local->tmp_channel) { -bool on_oper_chan =ieee80211_cfg_on_oper_channel (local); local->tmp_channel =NULL ;/* If tmp_channel wasn't operating channel, then * we need to go back on-channel.
@@ -1077,7 +1076,7 @@ static void ieee80211_work_work(struct w* we still need to do a hardware config. Currently, * we cannot be here while scanning, however. */ -if (ieee80211_cfg_on_oper_channel (local) && !on_oper_chan) +if (!ieee80211_cfg_on_oper_channel (local))ieee80211_hw_config (local,0 );/* At the least, we need to disable offchannel_ps,
PATCH 240/262 mac80211: disable powersave for broken APs
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 05cb91085760ca378f28fc274fbf77fc4fd9886c upstream.
Only AID values 1-2007 are valid, but some APs have been found to send random bogus values, in the reported case an AP that was sending the AID field value 0xffff, an AID of 0x3fff (16383).
There isn't much we can do but disable powersave since there's no way it can work properly in this case.
--- net/mac80211/ieee80211_i.h | 1 + net/mac80211/mlme.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-)
net/mac80211/ieee80211_i.h +1 -0
@@ -373,6 +373,7 @@ struct ieee80211_if_managed {unsigned long timers_running;/* used for quiesce/restart */ bool powersave;/* powersave requested for this iface */ +bool broken_ap;/* AP is broken -- turn off powersave */ enum ieee80211_smps_mode req_smps,/* requested smps mode */ ap_smps,/* smps mode AP thinks we're in */ driver_smps_mode;/* smps mode request */
net/mac80211/mlme.c +16 -2
@@ -613,6 +613,9 @@ static bool ieee80211_powersave_allowed(if (!mgd->powersave)return false; +if (mgd->broken_ap) +return false; +if (!mgd->associated)return false;
@@ -1450,10 +1453,21 @@ static bool ieee80211_assoc_success(stru capab_info =le16_to_cpu (mgmt->u.assoc_resp.capab_info);if ((aid & (BIT (15 ) |BIT (14 ))) != (BIT (15 ) |BIT (14 ))) -printk (KERN_DEBUG "%s: invalid aid value %d; bits 15:14 not " -"set\n" , sdata->name, aid); +printk (KERN_DEBUG +"%s: invalid AID value 0x%x; bits 15:14 not set\n" , + sdata->name, aid); aid &= ~(BIT (15 ) |BIT (14 )); + ifmgd->broken_ap = false; + +if (aid ==0 || aid >IEEE80211_MAX_AID ) { +printk (KERN_DEBUG +"%s: invalid AID value %d (out of range), turn off PS\n" , + sdata->name, aid); + aid =0 ; + ifmgd->broken_ap = true; + } + pos = mgmt->u.assoc_resp.variable;ieee802_11_parse_elems (pos, len - (pos - (u8 *) mgmt), &elems);
PATCH 241/262 mtd: mtdchar: add missing initializer on raw write
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Wippich <[email protected]>
commit bf5140817b2d65faac9b32fc9057a097044ac35b upstream.
On writes in MODE_RAW the mtd_oob_ops struct is not sufficiently initialized which may cause nandwrite to fail. With this patch it is possible to write raw nand/oob data without additional ECC (either for testing or when some sectors need different oob layout e.g. bootloader) like
nandwrite -n -r -o /dev/mtd0 <myfile>
--- drivers/mtd/mtdchar.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/mtdchar.c +1 -0
@@ -320,6 +320,7 @@ static ssize_t mtd_write(struct file *fi ops.mode =MTD_OOB_RAW ; ops.datbuf = kbuf; ops.oobbuf =NULL ; + ops.ooboffs =0 ; ops.len = len; ret = mtd->write_oob (mtd, *ppos, &ops);
PATCH 242/262 mtd: provide an alias for the redboot module name
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andres Salomon <[email protected]>
commit d5de1907d0af22e1a02de2b16a624148517a39c2 upstream.
parse_mtd_partitions takes a list of partition types; if the driver isn't loaded, it attempts to load it, and then it grabs the partition parser. For redboot, the module name is "redboot.ko", while the parser name is "RedBoot". Since modprobe is case-sensitive, attempting to modprobe "RedBoot" will never work. I suspect the embedded systems that make use of redboot just always manually loaded redboot prior to loading their specific nand chip drivers (or statically compiled it in).
--- drivers/mtd/redboot.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mtd/redboot.c +3 -0
@@ -297,6 +297,9 @@ static struct mtd_part_parser redboot_pa .name = "RedBoot", }; +/* mtd parsers will request the module by parser name */ +MODULE_ALIAS ("RedBoot" ); +static int __init redboot_parser_init (void ) {return register_mtd_parser (&redboot_parser);
PATCH 243/262 mtd: pxa3xx_nand: fix nand detection issue
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lei Wen <[email protected]>
commit 0fab028b77d714ad302404b23306cf7adb885223 upstream.
When keep_config is set, the detection would goes different routine. That the driver would read out the setting which is set previously by bootloader. While most bootloader keep the irq mask as off, and current driver need all irq default open, keep_config behavior would lead to no irq at all.
--- drivers/mtd/nand/pxa3xx_nand.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/mtd/nand/pxa3xx_nand.c +7 -5
@@ -813,7 +813,7 @@ static int pxa3xx_nand_detect_config(str info->page_size = ndcr &NDCR_PAGE_SZ ?2048 :512 ;/* set info fields needed to read id */ info->read_id_bytes = (info->page_size ==2048 ) ?4 :2 ; - info->reg_ndcr = ndcr; + info->reg_ndcr = ndcr & ~NDCR_INT_MASK ; info->cmdset = &default_cmdset; info->ndtr0cs0 =nand_readl (info,NDTR0CS0 );
@@ -882,7 +882,7 @@ static int pxa3xx_nand_scan(struct mtd_istruct pxa3xx_nand_info *info = mtd->priv;struct platform_device *pdev = info->pdev;struct pxa3xx_nand_platform_data *pdata = pdev->dev.platform_data; -struct nand_flash_dev pxa3xx_flash_ids[2 ] = { {NULL ,}, {NULL ,} }; +struct nand_flash_dev pxa3xx_flash_ids[2 ], *def =NULL ;const struct pxa3xx_nand_flash *f =NULL ;struct nand_chip *chip = mtd->priv;uint32_t id =-1 ;
@@ -942,8 +942,10 @@ static int pxa3xx_nand_scan(struct mtd_i pxa3xx_flash_ids[0 ].erasesize = f->page_size * f->page_per_block;if (f->flash_width ==16 ) pxa3xx_flash_ids[0 ].options =NAND_BUSWIDTH_16 ; + pxa3xx_flash_ids[1 ].name =NULL ; + def = pxa3xx_flash_ids; KEEP_CONFIG: -if (nand_scan_ident (mtd,1 , pxa3xx_flash_ids)) +if (nand_scan_ident (mtd,1 , def))return -ENODEV ;/* calculate addressing information */ info->col_addr_cycles = (mtd->writesize >=2048 ) ?2 :1 ;
@@ -954,9 +956,9 @@ KEEP_CONFIG: info->row_addr_cycles =2 ; mtd->name = mtd_names[0 ]; chip->ecc.mode =NAND_ECC_HW ; - chip->ecc.size = f->page_size; + chip->ecc.size = info->page_size; - chip->options = (f->flash_width ==16 ) ?NAND_BUSWIDTH_16 :0 ; + chip->options = (info->reg_ndcr &NDCR_DWIDTH_M ) ?NAND_BUSWIDTH_16 :0 ; chip->options |=NAND_NO_AUTOINCR ; chip->options |=NAND_NO_READRDY ;
PATCH 244/262 mtd: pxa3xx_nand: Fix blank page ECC mismatch
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Mack <[email protected]>
commit 543e32d5ff165d0d68deedb0e3557478c7c36a4a upstream.
This bug was introduced in f8155a40 ("mtd: pxa3xx_nand: rework irq logic") and causes the PXA3xx NAND controller fail to operate with NAND flash that has empty pages. According to the comment in this block, the hardware controller will report a double-bit error for empty pages, which can and must be ignored.
This patch restores the original behaviour of the driver.
--- drivers/mtd/nand/pxa3xx_nand.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mtd/nand/pxa3xx_nand.c +2 -0
@@ -685,6 +685,8 @@ static int pxa3xx_nand_read_page_hwecc(s* OOB, ignore such double bit errors */ if (is_buf_blank (buf, mtd->writesize)) + info->retcode =ERR_NONE ; +else mtd->ecc_stats.failed++; }
PATCH 245/262 ext4: remove i_mutex lock in ext4_evict_inode to fix lockdep complaining
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiaying Zhang <[email protected]>
commit 8c0bec2151a47906bf779c6715a10ce04453ab77 upstream.
The i_mutex lock and flush_completed_IO() added by commit 2581fdc810 in ext4_evict_inode() causes lockdep complaining about potential deadlock in several places. In most/all of these LOCKDEP complaints it looks like it's a false positive, since many of the potential circular locking cases can't take place by the time the ext4_evict_inode() is called; but since at the very least it may mask real problems, we need to address this.
This change removes the flush_completed_IO() and i_mutex lock in ext4_evict_inode(). Instead, we take a different approach to resolve the software lockup that commit 2581fdc810 intends to fix. Rather than having ext4-dio-unwritten thread wait for grabing the i_mutex lock of an inode, we use mutex_trylock() instead, and simply requeue the work item if we fail to grab the inode's i_mutex lock.
This should speed up work queue processing in general and also prevents the following deadlock scenario: During page fault, shrink_icache_memory is called that in turn evicts another inode B. Inode B has some pending io_end work so it calls ext4_ioend_wait() that waits for inode B's i_ioend_count to become zero. However, inode B's ioend work was queued behind some of inode A's ioend work on the same cpu's ext4-dio-unwritten workqueue. As the ext4-dio-unwritten thread on that cpu is processing inode A's ioend work, it tries to grab inode A's i_mutex lock. Since the i_mutex lock of inode A is still hold before the page fault happened, we enter a deadlock.
--- fs/ext4/ext4.h | 1 + fs/ext4/inode.c | 3 --- fs/ext4/page-io.c | 18 +++++++++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-)
fs/ext4/ext4.h +1 -0
@@ -175,6 +175,7 @@ struct mpage_da_data {*/ #define EXT4_IO_END_UNWRITTEN 0x0001#define EXT4_IO_END_ERROR 0x0002 +#define EXT4_IO_END_QUEUED 0x0004struct ext4_io_page {struct page *p_page;
fs/ext4/inode.c +0 -3
@@ -190,9 +190,6 @@ void ext4_evict_inode(struct inode *inodtrace_ext4_evict_inode (inode); -mutex_lock (&inode->i_mutex); -ext4_flush_completed_IO (inode); -mutex_unlock (&inode->i_mutex);ext4_ioend_wait (inode);if (inode->i_nlink) {
fs/ext4/page-io.c +17 -1
@@ -142,7 +142,23 @@ static void ext4_end_io_work(struct workunsigned long flags;int ret; -mutex_lock (&inode->i_mutex); +if (!mutex_trylock (&inode->i_mutex)) { +/* +* Requeue the work instead of waiting so that the work +* items queued after this can be processed. +*/ +queue_work (EXT4_SB (inode->i_sb)->dio_unwritten_wq, &io->work); +/* +* To prevent the ext4-dio-unwritten thread from keeping +* requeueing end_io requests and occupying cpu for too long, +* yield the cpu if it sees an end_io request that has already +* been requeued. +*/ +if (io->flag &EXT4_IO_END_QUEUED ) +yield (); + io->flag |=EXT4_IO_END_QUEUED ; +return ; + } ret =ext4_end_io_nolock (io);if (ret <0 ) {mutex_unlock (&inode->i_mutex);
PATCH 246/262 net: Align AF-specific flowi structs to long
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Ward <[email protected]>
commit 728871bc05afc8ff310b17dba3e57a2472792b13 upstream.
AF-specific flowi structs are now passed to flow_key_compare, which must also be aligned to a long.
--- include/net/flow.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/net/flow.h +3 -3
@@ -68,7 +68,7 @@ struct flowi4 {#define fl4_ipsec_spi uli.spi#define fl4_mh_type uli.mht.type#define fl4_gre_key uli.gre_key -}; +} __attribute__((__aligned__(BITS_PER_LONG/8))); static inline void flowi4_init_output(struct flowi4 *fl4, int oif, __u32 mark, __u8 tos, __u8 scope,
@@ -112,7 +112,7 @@ struct flowi6 {#define fl6_ipsec_spi uli.spi#define fl6_mh_type uli.mht.type#define fl6_gre_key uli.gre_key -}; +} __attribute__((__aligned__(BITS_PER_LONG/8)));struct flowidn {struct flowi_common __fl_common;
@@ -127,7 +127,7 @@ struct flowidn {union flowi_uli uli;#define fld_sport uli.ports.sport#define fld_dport uli.ports.dport -}; +} __attribute__((__aligned__(BITS_PER_LONG/8))); struct flowi { union {
PATCH 247/262 net: Handle different key sizes between address families in flow cache
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: dpward <[email protected]>
commit aa1c366e4febc7f5c2b84958a2dd7cd70e28f9d0 upstream.
With the conversion of struct flowi to a union of AF-specific structs, some operations on the flow cache need to account for the exact size of the key.
--- include/net/flow.h | 19 +++++++++++++++++++ net/core/flow.c | 31 +++++++++++++++++-------------- 2 files changed, 36 insertions(+), 14 deletions(-)
include/net/flow.h +19 -0
@@ -7,6 +7,7 @@#ifndef _NET_FLOW_H#define _NET_FLOW_H +#include <linux/socket.h> #include <linux/in6.h> #include <asm/atomic.h>
@@ -161,6 +162,24 @@ static inline struct flowi *flowidn_to_f return container_of(fldn, struct flowi, u.dn); } +typedef unsigned long flow_compare_t ; + +static inline size_t flow_key_size (u16 family) +{ +switch (family) { +case AF_INET : +BUILD_BUG_ON (sizeof (struct flowi4 ) %sizeof (flow_compare_t)); +return sizeof (struct flowi4 ) /sizeof (flow_compare_t); +case AF_INET6 : +BUILD_BUG_ON (sizeof (struct flowi6 ) %sizeof (flow_compare_t)); +return sizeof (struct flowi6 ) /sizeof (flow_compare_t); +case AF_DECnet: +BUILD_BUG_ON (sizeof (struct flowidn ) %sizeof (flow_compare_t)); +return sizeof (struct flowidn ) /sizeof (flow_compare_t); + } +return 0 ; +} +#define FLOW_DIR_IN 0#define FLOW_DIR_OUT 1#define FLOW_DIR_FWD 2
net/core/flow.c +17 -14
@@ -172,29 +172,26 @@ static void flow_new_hash_rnd(struct flostatic u32 flow_hash_code (struct flow_cache *fc,struct flow_cache_percpu *fcp, -const struct flowi *key) +const struct flowi *key, +size_t keysize) {const u32 *k = (const u32 *) key; +const u32 length = keysize *sizeof (flow_compare_t) /sizeof (u32); -return jhash2 (k, (sizeof (*key) /sizeof (u32)), fcp->hash_rnd) +return jhash2 (k, length, fcp->hash_rnd) & (flow_cache_hash_size (fc) -1 ); } -typedef unsigned long flow_compare_t ; -/* I hear what you're saying, use memcmp. But memcmp cannot make -* important assumptions that we can here, such as alignment and -* constant size. +* important assumptions that we can here, such as alignment. */ -static int flow_key_compare (const struct flowi *key1,const struct flowi *key2) +static int flow_key_compare (const struct flowi *key1,const struct flowi *key2, +size_t keysize) {const flow_compare_t *k1, *k1_lim, *k2; -const int n_elem =sizeof (struct flowi ) /sizeof (flow_compare_t); - -BUILD_BUG_ON (sizeof (struct flowi ) %sizeof (flow_compare_t)); k1 = (const flow_compare_t *) key1; - k1_lim = k1 + n_elem; + k1_lim = k1 + keysize; k2 = (const flow_compare_t *) key2;
@@ -215,6 +212,7 @@ flow_cache_lookup(struct net *net, conststruct flow_cache_entry *fle, *tfle;struct hlist_node *entry;struct flow_cache_object *flo; +size_t keysize;unsigned int hash;local_bh_disable ();
@@ -222,6 +220,11 @@ flow_cache_lookup(struct net *net, const fle =NULL ; flo =NULL ; + + keysize =flow_key_size (family); +if (!keysize) + goto nocache; +/* Packet really early in init? Making flow_cache_init a * pre-smp initcall would solve this. --RR */ if (!fcp->hash_table)
@@ -230,11 +233,11 @@ flow_cache_lookup(struct net *net, constif (fcp->hash_rnd_recalc)flow_new_hash_rnd (fc, fcp); - hash =flow_hash_code (fc, fcp, key); + hash =flow_hash_code (fc, fcp, key, keysize);hlist_for_each_entry (tfle, entry, &fcp->hash_table[hash], u.hlist) {if (tfle->family == family && tfle->dir == dir && -flow_key_compare (key, &tfle->key) ==0 ) { +flow_key_compare (key, &tfle->key, keysize) ==0 ) { fle = tfle;break ; }
@@ -248,7 +251,7 @@ flow_cache_lookup(struct net *net, constif (fle) { fle->family = family; fle->dir = dir; -memcpy (&fle->key, key,sizeof (*key)); +memcpy (&fle->key, key, keysize *sizeof (flow_compare_t)); fle->object =NULL ;hlist_add_head (&fle->u.hlist, &fcp->hash_table[hash]); fcp->hash_count++;
PATCH 248/262 PM / Suspend: Off by one in pm_suspend()
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 528f7ce6e439edeac38f6b3f8561f1be129b5e91 upstream.
In enter_state() we use "state" as an offset for the pm_states[] array. The pm_states[] array only has PM_SUSPEND_MAX elements so this test is off by one.
--- kernel/power/suspend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/power/suspend.c +1 -1
@@ -307,7 +307,7 @@ int enter_state(suspend_state_t state)*/ int pm_suspend (suspend_state_t state) { -if (state >PM_SUSPEND_ON && state <=PM_SUSPEND_MAX ) +if (state >PM_SUSPEND_ON && state <PM_SUSPEND_MAX )return enter_state (state);return -EINVAL ; }
PATCH 249/262 crypto: cryptd - Use subsys_initcall to prevent races with aesni
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
commit b2bac6acf86d05d8af0499f37d91ecac15722803 upstream.
As cryptd is depeneded on by other algorithms such as aesni-intel, it needs to be registered before them. When everything is built as modules, this occurs naturally. However, for this to work when they are built-in, we need to use subsys_initcall in cryptd.
--- crypto/cryptd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/cryptd.c +1 -1
@@ -945,7 +945,7 @@ static void __exit cryptd_exit(void)crypto_unregister_template (&cryptd_tmpl); } -module_init (cryptd_init); +subsys_initcall (cryptd_init);module_exit (cryptd_exit);MODULE_LICENSE ("GPL" );
PATCH 250/262 dp83640: use proper function to free transmit time stamping packets
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Cochran <[email protected]>
commit f5ff7cd1a84caa9545d952a37ac872ccb73825fb upstream.
The previous commit enforces a new rule for handling the cloned packets for transmit time stamping. These packets must not be freed using any other function than skb_complete_tx_timestamp. This commit fixes the one and only driver using this API.
The driver first appeared in v3.0.
--- drivers/net/phy/dp83640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/dp83640.c +1 -1
@@ -1067,7 +1067,7 @@ static void dp83640_txtstamp(struct phy_struct dp83640_private *dp83640 = phydev->priv;if (!dp83640->hwts_tx_en) { -kfree_skb (skb); +skb_complete_tx_timestamp (skb,NULL );return ; }skb_queue_tail (&dp83640->tx_queue, skb);
PATCH 251/262 ath9k_hw: Fix regression of register offset for AR9003 chips
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rajkumar Manoharan <[email protected]>
commit 52d6d4ef5e6d1517688e27c11c01ab303ec681dd upstream.
My recent commits (3782c69d, 324c74a) introduced regression for register offset selection that based on the macversion. Not using parentheses in proper manner for ternary operator leads to select wrong offset for the registers.
This issue was observed with AR9462 chip that immediate disconnect after the association with the following message
ieee80211 phy3: wlan0: Failed to send nullfunc to AP 00:23:69:12:ea:47 after 500ms, disconnecting.
--- drivers/net/wireless/ath/ath9k/ar9003_phy.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_phy.h +6 -6
@@ -570,12 +570,12 @@#define AR_PHY_TXGAIN_TABLE (AR_SM_BASE + 0x300) -#define AR_PHY_TX_IQCAL_CONTROL_1 (AR_SM_BASE + AR_SREV_9485(ah) ? \ - 0x3c8 : 0x448) -#define AR_PHY_TX_IQCAL_START (AR_SM_BASE + AR_SREV_9485(ah) ? \ - 0x3c4 : 0x440) -#define AR_PHY_TX_IQCAL_STATUS_B0 (AR_SM_BASE + AR_SREV_9485(ah) ? \ - 0x3f0 : 0x48c) +#define AR_PHY_TX_IQCAL_CONTROL_1 (AR_SM_BASE + (AR_SREV_9485(ah) ? \ + 0x3c8 : 0x448)) +#define AR_PHY_TX_IQCAL_START (AR_SM_BASE + (AR_SREV_9485(ah) ? \ + 0x3c4 : 0x440)) +#define AR_PHY_TX_IQCAL_STATUS_B0 (AR_SM_BASE + (AR_SREV_9485(ah) ? \ + 0x3f0 : 0x48c))#define AR_PHY_TX_IQCAL_CORR_COEFF_B0 (_i) (AR_SM_BASE + \ (AR_SREV_9485(ah) ? \ 0x3d0 : 0x450) + ((_i) << 2))
PATCH 252/262 mtd: nand_base: always initialise oob_poi before writing OOB data
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "THOMSON, Adam (Adam)" <[email protected]>
commit f722013ee9fd24623df31dec9a91a6d02c3e2f2f upstream.
In nand_do_write_ops() code it is possible for a caller to provide ops.oobbuf populated and ops.mode == MTD_OOB_AUTO, which currently means that the chip->oob_poi buffer isn't initialised to all 0xFF. The nand_fill_oob() method then carries out the task of copying the provided OOB data to oob_poi, but with MTD_OOB_AUTO it skips areas marked as unavailable by the layout struct, including the bad block marker bytes.
An example of this causing issues is when the last OOB data read was from the start of a bad block where the markers are not 0xFF, and the caller wishes to write new OOB data at the beginning of another block. In this scenario the caller would provide OOB data, but nand_fill_oob() would skip the bad block marker bytes in oob_poi before copying the OOB data provided by the caller. This means that when the OOB data is written back to NAND, the block is inadvertently marked as bad without the caller knowing. This has been witnessed when using YAFFS2 where tags are stored in the OOB.
To avoid this oob_poi is always initialised to 0xFF to make sure no left over data is inadvertently written back to the OOB area.
Credits to Brian Norris <[email protected]> for fixing this patch.
--- drivers/mtd/nand/nand_base.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-)
drivers/mtd/nand/nand_base.c +16 -11
@@ -2097,14 +2097,22 @@ static int nand_write_page(struct mtd_in/** * nand_fill_oob - [Internal] Transfer client buffer to oob -* @chip: nand chip structure +* @mtd: MTD device structure * @oob: oob data buffer * @len: oob data write length * @ops: oob ops structure */ -static uint8_t *nand_fill_oob (struct nand_chip *chip,uint8_t *oob,size_t len, -struct mtd_oob_ops *ops) +static uint8_t *nand_fill_oob (struct mtd_info *mtd,uint8_t *oob,size_t len, +struct mtd_oob_ops *ops) { +struct nand_chip *chip = mtd->priv; + +/* +* Initialise to all 0xFF, to avoid the possibility of left over OOB +* data from a previous OOB read. +*/ +memset (chip->oob_poi,0xff , mtd->oobsize); +switch (ops->mode) {case MTD_OOB_PLACE :
@@ -2201,10 +2209,6 @@ static int nand_do_write_ops(struct mtd_ (chip->pagebuf << chip->page_shift) < (to + ops->len)) chip->pagebuf = -1; -/* If we're not given explicit OOB data, let it be 0xFF */ -if (likely (!oob)) -memset (chip->oob_poi,0xff , mtd->oobsize); -/* Don't allow multipage oob writes with offset */ if (oob && ops->ooboffs && (ops->ooboffs + ops->ooblen > oobmaxlen))return -EINVAL ;
@@ -2226,8 +2230,11 @@ static int nand_do_write_ops(struct mtd_if (unlikely (oob)) {size_t len =min (oobwritelen, oobmaxlen); - oob =nand_fill_oob (chip, oob, len, ops); + oob =nand_fill_oob (mtd, oob, len, ops); oobwritelen -= len; + }else { +/* We still need to erase leftover OOB data */ +memset (chip->oob_poi,0xff , mtd->oobsize); } ret = chip->write_page(mtd, chip, wbuf, page, cached,
@@ -2401,10 +2408,8 @@ static int nand_do_write_oob(struct mtd_if (page == chip->pagebuf) chip->pagebuf =-1 ; -memset (chip->oob_poi,0xff , mtd->oobsize); -nand_fill_oob (chip, ops->oobbuf, ops->ooblen, ops); +nand_fill_oob (mtd, ops->oobbuf, ops->ooblen, ops); status = chip->ecc.write_oob (mtd, chip, page & chip->pagemask); -memset (chip->oob_poi,0xff , mtd->oobsize);if (status)return status;
PATCH 253/262 HID: add support for new revision of Apple aluminum keyboard
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Bastone <[email protected]>
commit 4a4c879904aa0cc64629e14a49b64fb3d149bf1a upstream.
Add USB device ids for the new revision (MB110LL/B) of Apple's wired aluminum keyboard. I have only confirmed that the ANSI version is correct - it is assumed that the ISO and JIS versions follow the standard numbering convention.
--- drivers/hid/hid-apple.c | 6 ++++++ drivers/hid/hid-core.c | 3 +++ drivers/hid/hid-ids.h | 3 +++ 3 files changed, 12 insertions(+)
drivers/hid/hid-apple.c +6 -0
@@ -444,6 +444,12 @@ static const struct hid_device_id apple_ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS), .driver_data =APPLE_NUMLOCK_EMULATION |APPLE_HAS_FN | APPLE_RDESC_JIS }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI), + .driver_data = APPLE_HAS_FN }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO), + .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_JIS), + .driver_data = APPLE_HAS_FN }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO),
drivers/hid/hid-core.c +3 -0
@@ -1340,6 +1340,9 @@ static const struct hid_device_id hid_ha { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_JIS) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
drivers/hid/hid-ids.h +3 -0
@@ -109,6 +109,9 @@#define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245#define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246#define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247 +#define USB_DEVICE_ID_APPLE_ALU_REVB_ANSI 0x024f +#define USB_DEVICE_ID_APPLE_ALU_REVB_ISO 0x0250 +#define USB_DEVICE_ID_APPLE_ALU_REVB_JIS 0x0251#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b
PATCH 254/262 HID: add support for HuiJia USB Gamepad connector
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Werther <[email protected]>
commit 6d1db0777981e1626ae71243984ac300b61789ff upstream.
Create each gamepad as a separate joystick
--- drivers/hid/hid-ids.h | 1 + drivers/hid/usbhid/hid-quirks.c | 1 + 2 files changed, 2 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -277,6 +277,7 @@#define USB_DEVICE_ID_PENPOWER 0x00f4#define USB_VENDOR_ID_GREENASIA 0x0e8f +#define USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD 0x3013#define USB_VENDOR_ID_GRETAGMACBETH 0x0971#define USB_DEVICE_ID_GRETAGMACBETH_HUEY 0x2005
drivers/hid/usbhid/hid-quirks.c +1 -0
@@ -47,6 +47,7 @@ static const struct hid_blacklist { { USB_VENDOR_ID_AFATECH, USB_DEVICE_ID_AFATECH_AF9016, HID_QUIRK_FULLSPEED_INTERVAL }, { USB_VENDOR_ID_ETURBOTOUCH, USB_DEVICE_ID_ETURBOTOUCH, HID_QUIRK_MULTI_INPUT }, + { USB_VENDOR_ID_GREENASIA, USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, { USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_TOUCHPACK, USB_DEVICE_ID_TOUCHPACK_RTS, HID_QUIRK_MULTI_INPUT },
PATCH 255/262 HID: add support for MacBookAir4,2 keyboard.
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Joshua V. Dillon" <[email protected]>
commit 5d922baa631058c7e37ae33e81c4d3e6437f8d1d upstream.
Added USB device IDs for MacBookAir4,2 keyboard. Device constants were copied from the MacBookAir3,2 constants. The 4,2 device specification is reportedly unchanged from the 3,2 predecessor and seems to work well.
--- drivers/hid/hid-apple.c | 9 +++++++++ drivers/hid/hid-ids.h | 3 +++ 2 files changed, 12 insertions(+)
drivers/hid/hid-apple.c +9 -0
@@ -183,6 +183,9 @@ static int hidinput_apple_event(struct hif (hid->product >=USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI && hid->product <=USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS ) table = macbookair_fn_keys; +else if (hid->product >=USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI && + hid->product <=USB_DEVICE_ID_APPLE_WELLSPRING6_JIS ) + table = macbookair_fn_keys;else if (hid->product <0x21d || hid->product >=0x300 ) table = powerbook_fn_keys;else
@@ -493,6 +496,12 @@ static const struct hid_device_id apple_ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI), + .driver_data = APPLE_HAS_FN }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ISO), + .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS), + .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
drivers/hid/hid-ids.h +3 -0
@@ -109,6 +109,9 @@#define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245#define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246#define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247 +#define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c +#define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d +#define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS 0x024e#define USB_DEVICE_ID_APPLE_ALU_REVB_ANSI 0x024f#define USB_DEVICE_ID_APPLE_ALU_REVB_ISO 0x0250#define USB_DEVICE_ID_APPLE_ALU_REVB_JIS 0x0251
PATCH 256/262 HID: hid-multitouch: Add LG Display Multitouch device.
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Brown <[email protected]>
commit c50bb1a4005630f47b5da26336f74a485033a515 upstream.
This panel is also known as the Dell ST2220Tc.
--- drivers/hid/Kconfig | 1 + drivers/hid/hid-core.c | 1 + drivers/hid/hid-ids.h | 3 +++ drivers/hid/hid-multitouch.c | 5 +++++ 4 files changed, 10 insertions(+)
drivers/hid/Kconfig +1 -0
@@ -314,6 +314,7 @@ config HID_MULTITOUCH - Hanvon dual touch panels - Ilitek dual touch panels - IrTouch Infrared USB panels + - LG Display panels (Dell ST2220Tc) - Lumio CrystalTouch panels - MosArt dual-touch panels - PenMount dual touch panels
drivers/hid/hid-core.c +1 -0
@@ -1398,6 +1398,7 @@ static const struct hid_device_id hid_ha { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) }, + { HID_USB_DEVICE(USB_VENDOR_ID_LG, USB_DEVICE_ID_LG_MULTITOUCH) }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2) },
drivers/hid/hid-ids.h +3 -0
@@ -423,6 +423,9 @@#define USB_DEVICE_ID_LD_HYBRID 0x2090#define USB_DEVICE_ID_LD_HEATCONTROL 0x20A0 +#define USB_VENDOR_ID_LG 0x1fd2 +#define USB_DEVICE_ID_LG_MULTITOUCH 0x0064 +#define USB_VENDOR_ID_LOGITECH 0x046d#define USB_DEVICE_ID_LOGITECH_RECEIVER 0xc101#define USB_DEVICE_ID_LOGITECH_HARMONY_FIRST 0xc110
drivers/hid/hid-multitouch.c +5 -0
@@ -672,6 +672,11 @@ static const struct hid_device_id mt_dev HID_USB_DEVICE(USB_VENDOR_ID_IRTOUCHSYSTEMS, USB_DEVICE_ID_IRTOUCH_INFRARED_USB) }, +/* LG Display panels */ + { .driver_data = MT_CLS_DEFAULT, +HID_USB_DEVICE (USB_VENDOR_ID_LG , + USB_DEVICE_ID_LG_MULTITOUCH) }, + /* Lumio panels */ { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE, HID_USB_DEVICE(USB_VENDOR_ID_LUMIO,
PATCH 257/262 HID: add MacBookAir4,2 to hid_have_special_driver[]
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Kosina <[email protected]>
commit f6f554f09c5b831efdaf67c449e18ca06ee648fe upstream.
Otherwise the generic driver wouldn't unbind from it and wouldn't let hid-apple to automatically take over.
--- drivers/hid/hid-core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/hid/hid-core.c +3 -0
@@ -1340,6 +1340,9 @@ static const struct hid_device_id hid_ha { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_JIS) },
PATCH 258/262 HID: Add support MacbookAir 4,1 keyboard
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nobuhiro Iwamatsu <[email protected]>
commit d762cc290b9f17e346f4297fd5984b70ce71ef66 upstream.
Added USB device IDs and keyboard map for MacBookAir 4,1 keyboard.
--- drivers/hid/hid-apple.c | 31 +++++++++++++++++++++++++++++++ drivers/hid/hid-core.c | 3 +++ drivers/hid/hid-ids.h | 3 +++ 3 files changed, 37 insertions(+)
drivers/hid/hid-apple.c +31 -0
@@ -82,6 +82,28 @@ static const struct apple_key_translatio { } }; +static const struct apple_key_translation macbookair4_fn_keys[] = { + {KEY_BACKSPACE ,KEY_DELETE }, + {KEY_ENTER ,KEY_INSERT }, + {KEY_F1 ,KEY_BRIGHTNESSDOWN ,APPLE_FLAG_FKEY }, + {KEY_F2 ,KEY_BRIGHTNESSUP ,APPLE_FLAG_FKEY }, + {KEY_F3 ,KEY_SCALE ,APPLE_FLAG_FKEY }, + {KEY_F4 ,KEY_DASHBOARD ,APPLE_FLAG_FKEY }, + {KEY_F5 ,KEY_KBDILLUMDOWN ,APPLE_FLAG_FKEY }, + {KEY_F6 ,KEY_KBDILLUMUP ,APPLE_FLAG_FKEY }, + {KEY_F7 ,KEY_PREVIOUSSONG ,APPLE_FLAG_FKEY }, + {KEY_F8 ,KEY_PLAYPAUSE ,APPLE_FLAG_FKEY }, + {KEY_F9 ,KEY_NEXTSONG ,APPLE_FLAG_FKEY }, + {KEY_F10 ,KEY_MUTE ,APPLE_FLAG_FKEY }, + {KEY_F11 ,KEY_VOLUMEDOWN ,APPLE_FLAG_FKEY }, + {KEY_F12 ,KEY_VOLUMEUP ,APPLE_FLAG_FKEY }, + {KEY_UP ,KEY_PAGEUP }, + {KEY_DOWN ,KEY_PAGEDOWN }, + {KEY_LEFT ,KEY_HOME }, + {KEY_RIGHT ,KEY_END }, + { } +}; +static const struct apple_key_translation apple_fn_keys[] = { {KEY_BACKSPACE ,KEY_DELETE }, {KEY_ENTER ,KEY_INSERT },
@@ -186,6 +208,9 @@ static int hidinput_apple_event(struct helse if (hid->product >=USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI && hid->product <=USB_DEVICE_ID_APPLE_WELLSPRING6_JIS ) table = macbookair_fn_keys; +else if (hid->product >=USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI && + hid->product <=USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS ) + table = macbookair4_fn_keys;else if (hid->product <0x21d || hid->product >=0x300 ) table = powerbook_fn_keys;else
@@ -502,6 +527,12 @@ static const struct hid_device_id apple_ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI), + .driver_data = APPLE_HAS_FN }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO), + .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS), + .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
drivers/hid/hid-core.c +3 -0
@@ -1343,6 +1343,9 @@ static const struct hid_device_id hid_ha { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_JIS) },
drivers/hid/hid-ids.h +3 -0
@@ -109,6 +109,9 @@#define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245#define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246#define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247 +#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI 0x0249 +#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO 0x024a +#define USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS 0x024b#define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c#define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d#define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS 0x024e
PATCH 259/262 HID: Add device IDs for Macbook Pro 8 keyboards
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gökçen Eraslan <[email protected]>
commit 213f9da80533940560bef8fa43b10c590895459c upstream.
This patch adds keyboard support for Macbook Pro 8 models which has WELLSPRING5A model name and 0x0252, 0x0253 and 0x0254 USB IDs. Trackpad support for those models are added to bcm5974 in c331eb580a0a7906c0cdb8dbae3cfe99e3c0e555 ("Input: bcm5974 - Add support for newer MacBookPro8,2).
--- drivers/hid/hid-apple.c | 6 ++++++ drivers/hid/hid-core.c | 6 ++++++ drivers/hid/hid-ids.h | 3 +++ 3 files changed, 15 insertions(+)
drivers/hid/hid-apple.c +6 -0
@@ -533,6 +533,12 @@ static const struct hid_device_id apple_ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI), + .driver_data = APPLE_HAS_FN }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO), + .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), + .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
drivers/hid/hid-core.c +6 -0
@@ -1340,6 +1340,9 @@ static const struct hid_device_id hid_ha { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS) },
@@ -1893,6 +1896,9 @@ static const struct hid_device_id hid_mo { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_JIS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, { }
drivers/hid/hid-ids.h +3 -0
@@ -118,6 +118,9 @@#define USB_DEVICE_ID_APPLE_ALU_REVB_ANSI 0x024f#define USB_DEVICE_ID_APPLE_ALU_REVB_ISO 0x0250#define USB_DEVICE_ID_APPLE_ALU_REVB_JIS 0x0251 +#define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI 0x0252 +#define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO 0x0253 +#define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS 0x0254#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b
PATCH 260/262 HID: hid-apple: add device ID of another wireless aluminium
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Krist <[email protected]>
commit ad734bc1565364f9e4b70888d3ce5743b3c1030a upstream.
I've recently bought a Apple wireless aluminum keyboard (model 2011) which is not yet supported by the kernel - it seems they just changed the device id. After applying the attached patch, the device is fully functional.
--- drivers/hid/hid-apple.c | 3 +++ drivers/hid/hid-core.c | 1 + drivers/hid/hid-ids.h | 1 + 3 files changed, 5 insertions(+)
drivers/hid/hid-apple.c +3 -0
@@ -483,6 +483,9 @@ static const struct hid_device_id apple_ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO), .driver_data =APPLE_NUMLOCK_EMULATION |APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO), + .driver_data =APPLE_NUMLOCK_EMULATION |APPLE_HAS_FN | + APPLE_ISO_KEYBOARD }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI),
drivers/hid/hid-core.c +1 -0
@@ -1355,6 +1355,7 @@ static const struct hid_device_id hid_ha { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_T91MT) },
drivers/hid/hid-ids.h +1 -0
@@ -124,6 +124,7 @@#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI 0x0239#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO 0x023a#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b +#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO 0x0256#define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a#define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b#define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241
PATCH 261/262 HID: consolidate MacbookAir 4,1 mappings
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Kosina <[email protected]>
commit da617c7cb915545dda4280df888dd6f8d5697420 upstream.
MacbookAir 4,1 doesn't require extra mapping table, as the mappings are identical to apple_fn_keys[].
--- drivers/hid/hid-apple.c | 25 ------------------------- 1 file changed, 25 deletions(-)
drivers/hid/hid-apple.c +0 -25
@@ -82,28 +82,6 @@ static const struct apple_key_translatio { } }; -static const struct apple_key_translation macbookair4_fn_keys[] = { - {KEY_BACKSPACE ,KEY_DELETE }, - {KEY_ENTER ,KEY_INSERT }, - {KEY_F1 ,KEY_BRIGHTNESSDOWN ,APPLE_FLAG_FKEY }, - {KEY_F2 ,KEY_BRIGHTNESSUP ,APPLE_FLAG_FKEY }, - {KEY_F3 ,KEY_SCALE ,APPLE_FLAG_FKEY }, - {KEY_F4 ,KEY_DASHBOARD ,APPLE_FLAG_FKEY }, - {KEY_F5 ,KEY_KBDILLUMDOWN ,APPLE_FLAG_FKEY }, - {KEY_F6 ,KEY_KBDILLUMUP ,APPLE_FLAG_FKEY }, - {KEY_F7 ,KEY_PREVIOUSSONG ,APPLE_FLAG_FKEY }, - {KEY_F8 ,KEY_PLAYPAUSE ,APPLE_FLAG_FKEY }, - {KEY_F9 ,KEY_NEXTSONG ,APPLE_FLAG_FKEY }, - {KEY_F10 ,KEY_MUTE ,APPLE_FLAG_FKEY }, - {KEY_F11 ,KEY_VOLUMEDOWN ,APPLE_FLAG_FKEY }, - {KEY_F12 ,KEY_VOLUMEUP ,APPLE_FLAG_FKEY }, - {KEY_UP ,KEY_PAGEUP }, - {KEY_DOWN ,KEY_PAGEDOWN }, - {KEY_LEFT ,KEY_HOME }, - {KEY_RIGHT ,KEY_END }, - { } -}; -static const struct apple_key_translation apple_fn_keys[] = { {KEY_BACKSPACE ,KEY_DELETE }, {KEY_ENTER ,KEY_INSERT },
@@ -208,9 +186,6 @@ static int hidinput_apple_event(struct helse if (hid->product >=USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI && hid->product <=USB_DEVICE_ID_APPLE_WELLSPRING6_JIS ) table = macbookair_fn_keys; -else if (hid->product >=USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI && - hid->product <=USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS ) - table = macbookair4_fn_keys;else if (hid->product <0x21d || hid->product >=0x300 ) table = powerbook_fn_keys;else
PATCH 262/262 hid/apple: modern macbook airs use the standard apple function key translations
In reply to Greg KH3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit 21404b772a1c65f7b935b8c0fddc388a949f4e31 upstream.
This removes the use of the special "macbookair_fn_keys" keyboard translation table for the MacBookAir4,x models (ie the 2011 refresh). They use the standard apple_fn_keys[] translation. Apparently only the old MacBook Air's need a different translation table.
This mirrors the change that commit da617c7cb915 ("HID: consolidate MacbookAir 4,1 mappings") did for the WELLSPRING6A ones, but does it for the WELLSPRING6 model used on the MacBookAir4,2.
--- drivers/hid/hid-apple.c | 3 --- 1 file changed, 3 deletions(-)
drivers/hid/hid-apple.c +0 -3
@@ -183,9 +183,6 @@ static int hidinput_apple_event(struct hif (hid->product >=USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI && hid->product <=USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS ) table = macbookair_fn_keys; -else if (hid->product >=USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI && - hid->product <=USB_DEVICE_ID_APPLE_WELLSPRING6_JIS ) - table = macbookair_fn_keys;else if (hid->product <0x21d || hid->product >=0x300 ) table = powerbook_fn_keys;else
Quoted 1 line · Greg KH
This is the start of the stable review cycle for the 3.0.9 release.
Could you include these two:
a94cc4e sfi: table irq 0xFF means 'no interrupt' 153b19a x86, mrst: use a temporary variable for SFI irq
Signature · 1 line
Kirill A. Shutemov
Quoted 6 lines · Kirill A. Shutemov
Quoted 1 line · Greg KH
This is the start of the stable review cycle for the 3.0.9 release.
Could you include these two:
a94cc4e sfi: table irq
0xFFmeans 'no interrupt'
Why was this not marked for stable?
Quoted 1 line
153b19a x86, mrst: use a temporary variable for SFI irq
Odd, I wonder how I missed this one.
Anyway, I'll queue these up for the next 3.0 release after this one if you don't mind.
thanks,
greg k-h
Quoted 9 lines · Greg KH
Quoted 6 lines · Kirill A. Shutemov
Quoted 1 line · Greg KH
This is the start of the stable review cycle for the 3.0.9 release.
Could you include these two:
a94cc4e sfi: table irq
0xFFmeans 'no interrupt'Why was this not marked for stable?
Hm.. I don't know. But the patch was queued for 3.0.5.
http://lkml.org/lkml/2011/9/29/357
Quoted 3 lines
Quoted 1 line
153b19a x86, mrst: use a temporary variable for SFI irq
Odd, I wonder how I missed this one.
There's dependency on the first patch, but you've forgot our first conversation, I guess.
Quoted 2 lines
Anyway, I'll queue these up for the next 3.0 release after this one if you don't mind.
Ok, thank you.
Signature · 1 line
Kirill A. Shutemov
Quoted 13 lines · Kirill A. Shutemov
Quoted 9 lines · Greg KH
Quoted 6 lines · Kirill A. Shutemov
Quoted 1 line · Greg KH
This is the start of the stable review cycle for the 3.0.9 release.
Could you include these two:
a94cc4e sfi: table irq
0xFFmeans 'no interrupt'Why was this not marked for stable?
Hm.. I don't know. But the patch was queued for 3.0.5.
Quoted 8 lines
http://lkml.org/lkml/2011/9/29/357
Quoted 3 lines
Quoted 1 line
153b19a x86, mrst: use a temporary variable for SFI irq
Odd, I wonder how I missed this one.
There's dependency on the first patch, but you've forgot our first conversation, I guess.
Yes I have, when dealing with 260+ patches, you tend to forget the conversations of the previous release...
greg k-h
Quoted 9 lines
Quoted 3 lines
Could you include these two:
a94cc4e sfi: table irq
0xFFmeans 'no interrupt'Why was this not marked for stable?
Quoted 1 line
153b19a x86, mrst: use a temporary variable for SFI irq
Odd, I wonder how I missed this one.
Because at the time the first one was submitted to stable it needed the second which wasn't in Linus tree.
Alan