From bea9e9cd3fc01ac181523d65b3a06681c9993c76 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 22 Jan 2012 17:20:58 -0700 Subject: [PATCH] 3.0-stable patches added patches: i2c-eg20t-modified-the-setting-of-transfer-rate.patch net-fix-driver-name-for-mdio-gpio.c.patch pnfs-obj-must-return-layout-on-io-error.patch pnfs-obj-pnfs-errors-are-communicated-on-iodata-pnfs_error.patch rt2800pci-fix-spurious-interrupts-generation.patch --- ...odified-the-setting-of-transfer-rate.patch | 31 +++++++ .../net-fix-driver-name-for-mdio-gpio.c.patch | 33 +++++++ ...s-obj-must-return-layout-on-io-error.patch | 86 +++++++++++++++++++ ...re-communicated-on-iodata-pnfs_error.patch | 62 +++++++++++++ ...i-fix-spurious-interrupts-generation.patch | 84 ++++++++++++++++++ queue-3.0/series | 5 ++ 6 files changed, 301 insertions(+) create mode 100644 queue-3.0/i2c-eg20t-modified-the-setting-of-transfer-rate.patch create mode 100644 queue-3.0/net-fix-driver-name-for-mdio-gpio.c.patch create mode 100644 queue-3.0/pnfs-obj-must-return-layout-on-io-error.patch create mode 100644 queue-3.0/pnfs-obj-pnfs-errors-are-communicated-on-iodata-pnfs_error.patch create mode 100644 queue-3.0/rt2800pci-fix-spurious-interrupts-generation.patch diff --git a/queue-3.0/i2c-eg20t-modified-the-setting-of-transfer-rate.patch b/queue-3.0/i2c-eg20t-modified-the-setting-of-transfer-rate.patch new file mode 100644 index 00000000000..be499d51afc --- /dev/null +++ b/queue-3.0/i2c-eg20t-modified-the-setting-of-transfer-rate.patch @@ -0,0 +1,31 @@ +From ff35e8b18984ad2a82cbd259fc07f0be4b34b1aa Mon Sep 17 00:00:00 2001 +From: Toshiharu Okada +Date: Mon, 26 Sep 2011 16:16:23 +0900 +Subject: i2c-eg20t: modified the setting of transfer rate. + +From: Toshiharu Okada + +commit ff35e8b18984ad2a82cbd259fc07f0be4b34b1aa upstream. + +This patch modified the setting value of +I2C Bus Transfer Rate Setting Counter regisrer. + +Signed-off-by: Toshiharu Okada +Signed-off-by: Ben Dooks +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/i2c/busses/i2c-eg20t.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/i2c/busses/i2c-eg20t.c ++++ b/drivers/i2c/busses/i2c-eg20t.c +@@ -242,7 +242,7 @@ static void pch_i2c_init(struct i2c_algo + if (pch_clk > PCH_MAX_CLK) + pch_clk = 62500; + +- pch_i2cbc = (pch_clk + (pch_i2c_speed * 4)) / pch_i2c_speed * 8; ++ pch_i2cbc = (pch_clk + (pch_i2c_speed * 4)) / (pch_i2c_speed * 8); + /* Set transfer speed in I2CBC */ + iowrite32(pch_i2cbc, p + PCH_I2CBC); + diff --git a/queue-3.0/net-fix-driver-name-for-mdio-gpio.c.patch b/queue-3.0/net-fix-driver-name-for-mdio-gpio.c.patch new file mode 100644 index 00000000000..97ce219eeb8 --- /dev/null +++ b/queue-3.0/net-fix-driver-name-for-mdio-gpio.c.patch @@ -0,0 +1,33 @@ +From f42af6c486aa5ca6ee62800cb45c5b252020509d Mon Sep 17 00:00:00 2001 +From: Dirk Eibach +Date: Tue, 18 Oct 2011 03:04:11 +0000 +Subject: net: Fix driver name for mdio-gpio.c + +From: Dirk Eibach + +commit f42af6c486aa5ca6ee62800cb45c5b252020509d upstream. + +Since commit +"7488876... dt/net: Eliminate users of of_platform_{,un}register_driver" +there are two platform drivers named "mdio-gpio" registered. +I renamed the of variant to "mdio-ofgpio". + +Signed-off-by: Dirk Eibach +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/phy/mdio-gpio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/phy/mdio-gpio.c ++++ b/drivers/net/phy/mdio-gpio.c +@@ -241,7 +241,7 @@ MODULE_DEVICE_TABLE(of, mdio_ofgpio_matc + + static struct platform_driver mdio_ofgpio_driver = { + .driver = { +- .name = "mdio-gpio", ++ .name = "mdio-ofgpio", + .owner = THIS_MODULE, + .of_match_table = mdio_ofgpio_match, + }, diff --git a/queue-3.0/pnfs-obj-must-return-layout-on-io-error.patch b/queue-3.0/pnfs-obj-must-return-layout-on-io-error.patch new file mode 100644 index 00000000000..b914400be44 --- /dev/null +++ b/queue-3.0/pnfs-obj-must-return-layout-on-io-error.patch @@ -0,0 +1,86 @@ +From fe0fe83585f88346557868a803a479dfaaa0688a Mon Sep 17 00:00:00 2001 +From: Boaz Harrosh +Date: Fri, 6 Jan 2012 09:31:20 +0200 +Subject: pnfs-obj: Must return layout on IO error + +From: Boaz Harrosh + +commit fe0fe83585f88346557868a803a479dfaaa0688a upstream. + +As mandated by the standard. In case of an IO error, a pNFS +objects layout driver must return it's layout. This is because +all device errors are reported to the server as part of the +layout return buffer. + +This is implemented the same way PNFS_LAYOUTRET_ON_SETATTR +is done, through a bit flag on the pnfs_layoutdriver_type->flags +member. The flag is set by the layout driver that wants a +layout_return preformed at pnfs_ld_{write,read}_done in case +of an error. +(Though I have not defined a wrapper like pnfs_ld_layoutret_on_setattr + because this code is never called outside of pnfs.c and pnfs IO + paths) + +Without this patch 3.[0-2] Kernels leak memory and have an annoying +WARN_ON after every IO error utilizing the pnfs-obj driver. + +Signed-off-by: Boaz Harrosh +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/objlayout/objio_osd.c | 3 ++- + fs/nfs/pnfs.c | 12 ++++++++++++ + fs/nfs/pnfs.h | 1 + + 3 files changed, 15 insertions(+), 1 deletion(-) + +--- a/fs/nfs/objlayout/objio_osd.c ++++ b/fs/nfs/objlayout/objio_osd.c +@@ -1006,7 +1006,8 @@ static bool objio_pg_test(struct nfs_pag + static struct pnfs_layoutdriver_type objlayout_type = { + .id = LAYOUT_OSD2_OBJECTS, + .name = "LAYOUT_OSD2_OBJECTS", +- .flags = PNFS_LAYOUTRET_ON_SETATTR, ++ .flags = PNFS_LAYOUTRET_ON_SETATTR | ++ PNFS_LAYOUTRET_ON_ERROR, + + .alloc_layout_hdr = objlayout_alloc_layout_hdr, + .free_layout_hdr = objlayout_free_layout_hdr, +--- a/fs/nfs/pnfs.c ++++ b/fs/nfs/pnfs.c +@@ -1119,6 +1119,14 @@ pnfs_ld_write_done(struct nfs_write_data + data->mds_ops->rpc_release(data); + return 0; + } ++ if (NFS_SERVER(data->inode)->pnfs_curr_ld->flags & ++ PNFS_LAYOUTRET_ON_ERROR) { ++ /* Don't lo_commit on error, Server will needs to ++ * preform a file recovery. ++ */ ++ clear_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(data->inode)->flags); ++ pnfs_return_layout(data->inode); ++ } + + dprintk("%s: pnfs_error=%d, retry via MDS\n", __func__, + data->pnfs_error); +@@ -1167,6 +1175,10 @@ pnfs_ld_read_done(struct nfs_read_data * + return 0; + } + ++ if (NFS_SERVER(data->inode)->pnfs_curr_ld->flags & ++ PNFS_LAYOUTRET_ON_ERROR) ++ pnfs_return_layout(data->inode); ++ + dprintk("%s: pnfs_error=%d, retry via MDS\n", __func__, + data->pnfs_error); + status = nfs_initiate_read(data, NFS_CLIENT(data->inode), +--- a/fs/nfs/pnfs.h ++++ b/fs/nfs/pnfs.h +@@ -68,6 +68,7 @@ enum { + enum layoutdriver_policy_flags { + /* Should the pNFS client commit and return the layout upon a setattr */ + PNFS_LAYOUTRET_ON_SETATTR = 1 << 0, ++ PNFS_LAYOUTRET_ON_ERROR = 1 << 1, + }; + + struct nfs4_deviceid_node; diff --git a/queue-3.0/pnfs-obj-pnfs-errors-are-communicated-on-iodata-pnfs_error.patch b/queue-3.0/pnfs-obj-pnfs-errors-are-communicated-on-iodata-pnfs_error.patch new file mode 100644 index 00000000000..dd52a2d1820 --- /dev/null +++ b/queue-3.0/pnfs-obj-pnfs-errors-are-communicated-on-iodata-pnfs_error.patch @@ -0,0 +1,62 @@ +From 5c0b4129c07b902b27d3f3ebc087757f534a3abd Mon Sep 17 00:00:00 2001 +From: Boaz Harrosh +Date: Fri, 6 Jan 2012 09:28:12 +0200 +Subject: pnfs-obj: pNFS errors are communicated on iodata->pnfs_error + +From: Boaz Harrosh + +commit 5c0b4129c07b902b27d3f3ebc087757f534a3abd upstream. + +Some time along the way pNFS IO errors were switched to +communicate with a special iodata->pnfs_error member instead +of the regular RPC members. But objlayout was not switched +over. + +Fix that! +Without this fix any IO error is hanged, because IO is not +switched to MDS and pages are never cleared or read. + +Signed-off-by: Boaz Harrosh +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + + +--- + fs/nfs/objlayout/objlayout.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +--- a/fs/nfs/objlayout/objlayout.c ++++ b/fs/nfs/objlayout/objlayout.c +@@ -294,9 +294,11 @@ objlayout_read_done(struct objlayout_io_ + dprintk("%s: Begin status=%zd eof=%d\n", __func__, status, eof); + rdata = state->rpcdata; + rdata->task.tk_status = status; +- if (status >= 0) { ++ if (likely(status >= 0)) { + rdata->res.count = status; + rdata->res.eof = eof; ++ } else { ++ rdata->pnfs_error = status; + } + objlayout_iodone(state); + /* must not use state after this point */ +@@ -380,15 +382,17 @@ objlayout_write_done(struct objlayout_io + wdata = state->rpcdata; + state->status = status; + wdata->task.tk_status = status; +- if (status >= 0) { ++ if (likely(status >= 0)) { + wdata->res.count = status; + wdata->verf.committed = state->committed; + dprintk("%s: Return status %d committed %d\n", + __func__, wdata->task.tk_status, + wdata->verf.committed); +- } else ++ } else { ++ wdata->pnfs_error = status; + dprintk("%s: Return status %d\n", + __func__, wdata->task.tk_status); ++ } + objlayout_iodone(state); + /* must not use state after this point */ + diff --git a/queue-3.0/rt2800pci-fix-spurious-interrupts-generation.patch b/queue-3.0/rt2800pci-fix-spurious-interrupts-generation.patch new file mode 100644 index 00000000000..74140ec4dec --- /dev/null +++ b/queue-3.0/rt2800pci-fix-spurious-interrupts-generation.patch @@ -0,0 +1,84 @@ +From dfd00c4c8f3dfa1fd7cec45f83d98b2a49743dcd Mon Sep 17 00:00:00 2001 +From: Stanislaw Gruszka +Date: Fri, 13 Jan 2012 12:59:32 +0100 +Subject: rt2800pci: fix spurious interrupts generation + +From: Stanislaw Gruszka + +commit dfd00c4c8f3dfa1fd7cec45f83d98b2a49743dcd upstream. + +Same devices can generate interrupt without properly setting bit in +INT_SOURCE_CSR register (spurious interrupt), what will cause IRQ line +will be disabled by interrupts controller driver. + +We discovered that clearing INT_MASK_CSR stops such behaviour. We +previously first read that register, and then clear all know interrupt +sources bits and do not touch reserved bits. After this patch, we write +to all register content (I believe writing to reserved bits on that +register will not cause any problems, I tested that on my rt2800pci +device). + +This fix very bad performance problem, practically making device +unusable (since worked without interrupts), reported in: +https://bugzilla.redhat.com/show_bug.cgi?id=658451 + +We previously tried to workaround that issue in commit +4ba7d9997869d25bd223dea7536fc1ce9fab3b3b "rt2800pci: handle spurious +interrupts", but it was reverted in commit +82e5fc2a34fa9ffea38f00c4066b7e600a0ca5e6 +as thing, that will prevent to detect real spurious interrupts. + +Reported-and-tested-by: Amir Hedayaty +Signed-off-by: Stanislaw Gruszka +Acked-by: Gertjan van Wingerde +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/rt2x00/rt2800pci.c | 28 ++++++++-------------------- + 1 file changed, 8 insertions(+), 20 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c +@@ -426,7 +426,6 @@ static int rt2800pci_init_queues(struct + static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev, + enum dev_state state) + { +- int mask = (state == STATE_RADIO_IRQ_ON); + u32 reg; + unsigned long flags; + +@@ -448,25 +447,14 @@ static void rt2800pci_toggle_irq(struct + } + + spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); +- rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, ®); +- rt2x00_set_field32(®, INT_MASK_CSR_RXDELAYINT, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_TXDELAYINT, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_RX_DONE, mask); +- rt2x00_set_field32(®, INT_MASK_CSR_AC0_DMA_DONE, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_AC1_DMA_DONE, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_AC2_DMA_DONE, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_AC3_DMA_DONE, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_HCCA_DMA_DONE, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_MGMT_DMA_DONE, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_MCU_COMMAND, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_RXTX_COHERENT, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_TBTT, mask); +- rt2x00_set_field32(®, INT_MASK_CSR_PRE_TBTT, mask); +- rt2x00_set_field32(®, INT_MASK_CSR_TX_FIFO_STATUS, mask); +- rt2x00_set_field32(®, INT_MASK_CSR_AUTO_WAKEUP, mask); +- rt2x00_set_field32(®, INT_MASK_CSR_GPTIMER, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_RX_COHERENT, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_TX_COHERENT, 0); ++ reg = 0; ++ if (state == STATE_RADIO_IRQ_ON) { ++ rt2x00_set_field32(®, INT_MASK_CSR_RX_DONE, 1); ++ rt2x00_set_field32(®, INT_MASK_CSR_TBTT, 1); ++ rt2x00_set_field32(®, INT_MASK_CSR_PRE_TBTT, 1); ++ rt2x00_set_field32(®, INT_MASK_CSR_TX_FIFO_STATUS, 1); ++ rt2x00_set_field32(®, INT_MASK_CSR_AUTO_WAKEUP, 1); ++ } + rt2x00pci_register_write(rt2x00dev, INT_MASK_CSR, reg); + spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + diff --git a/queue-3.0/series b/queue-3.0/series index 0f326a5a777..eb0012a3b3d 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -76,3 +76,8 @@ target-set-response-format-in-inquiry-response.patch target-set-additional-sense-length-field-in-sense-data.patch i2c-omap-correct-sysc-register-offset-for-omap4.patch x86-uv2-fix-bau-destination-timeout-initialization.patch +rt2800pci-fix-spurious-interrupts-generation.patch +pnfs-obj-pnfs-errors-are-communicated-on-iodata-pnfs_error.patch +pnfs-obj-must-return-layout-on-io-error.patch +net-fix-driver-name-for-mdio-gpio.c.patch +i2c-eg20t-modified-the-setting-of-transfer-rate.patch -- 2.47.3