From 805cb35cd43748beaa08b4da8f4fd474c54b4a2f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 25 Mar 2014 13:48:08 -0700 Subject: [PATCH] 3.4-stable patches added patches: hid-microsoft-add-id-s-for-surface-type-touch-cover-2.patch iwlwifi-complete-backport-of-iwlwifi-always-copy-first-16-bytes-of-commands.patch libceph-resend-all-writes-after-the-osdmap-loses-the-full-flag.patch --- ...-id-s-for-surface-type-touch-cover-2.patch | 64 +++++++++ ...ways-copy-first-16-bytes-of-commands.patch | 48 +++++++ ...after-the-osdmap-loses-the-full-flag.patch | 124 ++++++++++++++++++ queue-3.4/series | 3 + 4 files changed, 239 insertions(+) create mode 100644 queue-3.4/hid-microsoft-add-id-s-for-surface-type-touch-cover-2.patch create mode 100644 queue-3.4/iwlwifi-complete-backport-of-iwlwifi-always-copy-first-16-bytes-of-commands.patch create mode 100644 queue-3.4/libceph-resend-all-writes-after-the-osdmap-loses-the-full-flag.patch diff --git a/queue-3.4/hid-microsoft-add-id-s-for-surface-type-touch-cover-2.patch b/queue-3.4/hid-microsoft-add-id-s-for-surface-type-touch-cover-2.patch new file mode 100644 index 00000000000..30cee924368 --- /dev/null +++ b/queue-3.4/hid-microsoft-add-id-s-for-surface-type-touch-cover-2.patch @@ -0,0 +1,64 @@ +From 117309c51dca42121f70cacec801511b76acf75c Mon Sep 17 00:00:00 2001 +From: Reyad Attiyat +Date: Tue, 28 Jan 2014 16:17:57 +0100 +Subject: HID: microsoft: Add ID's for Surface Type/Touch Cover 2 + +From: Reyad Attiyat + +commit 117309c51dca42121f70cacec801511b76acf75c upstream. + +The Microsoft Surface Type/Touch cover 2 devices have the flag HID_DG_CONTACTID +in their reports.This causes the device to bind to the hid-multitouch driver, +which doesn't handle generic keyboard/mouse input events. The patch adds +the hardware id's of the device to hid-microsoft and to the HID special +driver array, which makes the device get handled by hid-generic/hid-input +properly. + +Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=64811 + +Singed-off-by: Reyad Attiyat +Reviewed-by: Benjamin Tissoires +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hid/hid-core.c | 2 ++ + drivers/hid/hid-ids.h | 2 ++ + drivers/hid/hid-microsoft.c | 4 ++++ + 3 files changed, 8 insertions(+) + +--- a/drivers/hid/hid-core.c ++++ b/drivers/hid/hid-core.c +@@ -1565,6 +1565,8 @@ static const struct hid_device_id hid_ha + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_USB) }, + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K) }, + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_2) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TOUCH_COVER_2) }, + { HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) }, + { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) }, + { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_1) }, +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -546,6 +546,8 @@ + #define USB_DEVICE_ID_MS_PRESENTER_8K_USB 0x0713 + #define USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K 0x0730 + #define USB_DEVICE_ID_MS_COMFORT_MOUSE_4500 0x076c ++#define USB_DEVICE_ID_MS_TOUCH_COVER_2 0x07a7 ++#define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9 + + #define USB_VENDOR_ID_MOJO 0x8282 + #define USB_DEVICE_ID_RETRO_ADAPTER 0x3201 +--- a/drivers/hid/hid-microsoft.c ++++ b/drivers/hid/hid-microsoft.c +@@ -206,6 +206,10 @@ static const struct hid_device_id ms_dev + .driver_data = MS_NOGET }, + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500), + .driver_data = MS_DUPLICATE_USAGES }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_2), ++ .driver_data = 0 }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TOUCH_COVER_2), ++ .driver_data = 0 }, + + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT), + .driver_data = MS_PRESENTER }, diff --git a/queue-3.4/iwlwifi-complete-backport-of-iwlwifi-always-copy-first-16-bytes-of-commands.patch b/queue-3.4/iwlwifi-complete-backport-of-iwlwifi-always-copy-first-16-bytes-of-commands.patch new file mode 100644 index 00000000000..be3040b2677 --- /dev/null +++ b/queue-3.4/iwlwifi-complete-backport-of-iwlwifi-always-copy-first-16-bytes-of-commands.patch @@ -0,0 +1,48 @@ +From ben@decadent.org.uk Tue Mar 25 13:41:21 2014 +From: Ben Hutchings +Date: Tue, 25 Mar 2014 17:28:22 +0000 +Subject: iwlwifi: Complete backport of "iwlwifi: always copy first 16 bytes of commands" +To: Greg Kroah-Hartman +Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Emmanuel Grumbach , Johannes Berg , Jianguo Wu , Andres Bertens , Andreas Sturmlechner +Message-ID: <1395768502.28354.7.camel@deadeye.wl.decadent.org.uk> + +From: Ben Hutchings + +Linux 3.4.83 included an incomplete backport of commit +8a964f44e01ad3bbc208c3e80d931ba91b9ea786 ('iwlwifi: always copy first +16 bytes of commands') which causes a regression for this driver. +This is the missing piece. + +Reported-by: Andreas Sturmlechner +Cc: Johannes Berg +Cc: Emmanuel Grumbach +Cc: Jianguo Wu +Cc: Andres Bertens +Tested-by: Andreas Sturmlechner +Signed-off-by: Ben Hutchings + +--- + drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c ++++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c +@@ -825,14 +825,15 @@ static int iwl_enqueue_hcmd(struct iwl_t + trace_idx = 1; + #endif + ++ /* map the remaining (adjusted) nocopy/dup fragments */ + for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { +- if (!cmd->len[i]) ++ if (!cmdlen[i]) + continue; + if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY)) + continue; + phys_addr = dma_map_single(trans->dev, +- (void *)cmd->data[i], +- cmd->len[i], DMA_BIDIRECTIONAL); ++ (void *)cmddata[i], ++ cmdlen[i], DMA_BIDIRECTIONAL); + if (dma_mapping_error(trans->dev, phys_addr)) { + iwlagn_unmap_tfd(trans, out_meta, + &txq->tfds[q->write_ptr], diff --git a/queue-3.4/libceph-resend-all-writes-after-the-osdmap-loses-the-full-flag.patch b/queue-3.4/libceph-resend-all-writes-after-the-osdmap-loses-the-full-flag.patch new file mode 100644 index 00000000000..89213df13f6 --- /dev/null +++ b/queue-3.4/libceph-resend-all-writes-after-the-osdmap-loses-the-full-flag.patch @@ -0,0 +1,124 @@ +From 9a1ea2dbff11547a8e664f143c1ffefc586a577a Mon Sep 17 00:00:00 2001 +From: Josh Durgin +Date: Tue, 10 Dec 2013 09:35:13 -0800 +Subject: libceph: resend all writes after the osdmap loses the full flag + +From: Josh Durgin + +commit 9a1ea2dbff11547a8e664f143c1ffefc586a577a upstream. + +With the current full handling, there is a race between osds and +clients getting the first map marked full. If the osd wins, it will +return -ENOSPC to any writes, but the client may already have writes +in flight. This results in the client getting the error and +propagating it up the stack. For rbd, the block layer turns this into +EIO, which can cause corruption in filesystems above it. + +To avoid this race, osds are being changed to drop writes that came +from clients with an osdmap older than the last osdmap marked full. +In order for this to work, clients must resend all writes after they +encounter a full -> not full transition in the osdmap. osds will wait +for an updated map instead of processing a request from a client with +a newer map, so resent writes will not be dropped by the osd unless +there is another not full -> full transition. + +This approach requires both osds and clients to be fixed to avoid the +race. Old clients talking to osds with this fix may hang instead of +returning EIO and potentially corrupting an fs. New clients talking to +old osds have the same behavior as before if they encounter this race. + +Fixes: http://tracker.ceph.com/issues/6938 + +Reviewed-by: Sage Weil +Signed-off-by: Josh Durgin +Signed-off-by: Greg Kroah-Hartman + +--- + net/ceph/osd_client.c | 28 ++++++++++++++++++++++------ + 1 file changed, 22 insertions(+), 6 deletions(-) + +--- a/net/ceph/osd_client.c ++++ b/net/ceph/osd_client.c +@@ -1269,14 +1269,17 @@ static void reset_changed_osds(struct ce + * + * Caller should hold map_sem for read. + */ +-static void kick_requests(struct ceph_osd_client *osdc, int force_resend) ++static void kick_requests(struct ceph_osd_client *osdc, bool force_resend, ++ bool force_resend_writes) + { + struct ceph_osd_request *req, *nreq; + struct rb_node *p; + int needmap = 0; + int err; ++ bool force_resend_req; + +- dout("kick_requests %s\n", force_resend ? " (force resend)" : ""); ++ dout("kick_requests %s %s\n", force_resend ? " (force resend)" : "", ++ force_resend_writes ? " (force resend writes)" : ""); + mutex_lock(&osdc->request_mutex); + for (p = rb_first(&osdc->requests); p; ) { + req = rb_entry(p, struct ceph_osd_request, r_node); +@@ -1299,7 +1302,10 @@ static void kick_requests(struct ceph_os + continue; + } + +- err = __map_request(osdc, req, force_resend); ++ force_resend_req = force_resend || ++ (force_resend_writes && ++ req->r_flags & CEPH_OSD_FLAG_WRITE); ++ err = __map_request(osdc, req, force_resend_req); + if (err < 0) + continue; /* error */ + if (req->r_osd == NULL) { +@@ -1319,7 +1325,8 @@ static void kick_requests(struct ceph_os + r_linger_item) { + dout("linger req=%p req->r_osd=%p\n", req, req->r_osd); + +- err = __map_request(osdc, req, force_resend); ++ err = __map_request(osdc, req, ++ force_resend || force_resend_writes); + dout("__map_request returned %d\n", err); + if (err == 0) + continue; /* no change and no osd was specified */ +@@ -1361,6 +1368,7 @@ void ceph_osdc_handle_map(struct ceph_os + struct ceph_osdmap *newmap = NULL, *oldmap; + int err; + struct ceph_fsid fsid; ++ bool was_full; + + dout("handle_map have %u\n", osdc->osdmap ? osdc->osdmap->epoch : 0); + p = msg->front.iov_base; +@@ -1374,6 +1382,8 @@ void ceph_osdc_handle_map(struct ceph_os + + down_write(&osdc->map_sem); + ++ was_full = ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_FULL); ++ + /* incremental maps */ + ceph_decode_32_safe(&p, end, nr_maps, bad); + dout(" %d inc maps\n", nr_maps); +@@ -1398,7 +1408,10 @@ void ceph_osdc_handle_map(struct ceph_os + ceph_osdmap_destroy(osdc->osdmap); + osdc->osdmap = newmap; + } +- kick_requests(osdc, 0); ++ was_full = was_full || ++ ceph_osdmap_flag(osdc->osdmap, ++ CEPH_OSDMAP_FULL); ++ kick_requests(osdc, 0, was_full); + } else { + dout("ignoring incremental map %u len %d\n", + epoch, maplen); +@@ -1441,7 +1454,10 @@ void ceph_osdc_handle_map(struct ceph_os + skipped_map = 1; + ceph_osdmap_destroy(oldmap); + } +- kick_requests(osdc, skipped_map); ++ was_full = was_full || ++ ceph_osdmap_flag(osdc->osdmap, ++ CEPH_OSDMAP_FULL); ++ kick_requests(osdc, skipped_map, was_full); + } + p += maplen; + nr_maps--; diff --git a/queue-3.4/series b/queue-3.4/series index 28f328f3811..1abafd3a81b 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -1 +1,4 @@ alsa-compress-pass-through-return-value-of-open-ops-callback.patch +hid-microsoft-add-id-s-for-surface-type-touch-cover-2.patch +libceph-resend-all-writes-after-the-osdmap-loses-the-full-flag.patch +iwlwifi-complete-backport-of-iwlwifi-always-copy-first-16-bytes-of-commands.patch -- 2.47.3