]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge 3.13-rc4 into char-misc-next
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2013 00:11:28 +0000 (16:11 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2013 00:11:28 +0000 (16:11 -0800)
We want these fixes in here.

31 files changed:
Documentation/HOWTO
Documentation/devicetree/bindings/misc/bmp085.txt
Documentation/ja_JP/HOWTO
Documentation/ko_KR/HOWTO
Documentation/zh_CN/HOWTO
drivers/char/agp/amd64-agp.c
drivers/misc/bmp085-i2c.c
drivers/misc/bmp085-spi.c
drivers/misc/bmp085.c
drivers/misc/bmp085.h
drivers/misc/eeprom/eeprom_93xx46.c
drivers/misc/lkdtm.c
drivers/misc/mei/client.c
drivers/misc/mei/init.c
drivers/misc/mei/interrupt.c
drivers/misc/mei/mei_dev.h
drivers/misc/mei/nfc.c
drivers/misc/mei/pci-me.c
drivers/misc/mic/host/mic_device.h
drivers/misc/mic/host/mic_main.c
drivers/misc/mic/host/mic_virtio.c
drivers/misc/mic/host/mic_x100.c
drivers/misc/ti-st/st_core.c
drivers/misc/ti-st/st_kim.c
drivers/parport/parport_pc.c
drivers/pcmcia/bfin_cf_pcmcia.c
drivers/pcmcia/electra_cf.c
drivers/uio/uio_mf624.c
drivers/w1/masters/mxc_w1.c
tools/hv/hv_kvp_daemon.c
tools/hv/hv_vss_daemon.c

index 27faae3e3846fa7557cd9a1f56836dd8382d790e..57cf5efb044da7f3c29586466455eaa1b55a77ae 100644 (file)
@@ -112,7 +112,7 @@ required reading:
 
     Other excellent descriptions of how to create patches properly are:
        "The Perfect Patch"
-               http://kerneltrap.org/node/3737
+               http://www.ozlabs.org/~akpm/stuff/tpp.txt
        "Linux kernel patch submission format"
                http://linux.yyz.us/patch-format.html
 
@@ -579,7 +579,7 @@ all time.  It should describe the patch completely, containing:
 For more details on what this should all look like, please see the
 ChangeLog section of the document:
   "The Perfect Patch"
-      http://userweb.kernel.org/~akpm/stuff/tpp.txt
+      http://www.ozlabs.org/~akpm/stuff/tpp.txt
 
 
 
index 91dfda2e4e11907291e81af51355939064b7d0e1..d7a6deb6b21e3d2e29d47a73081acaf4463d4d5e 100644 (file)
@@ -8,6 +8,8 @@ Optional properties:
 - temp-measurement-period: temperature measurement period (milliseconds)
 - default-oversampling: default oversampling value to be used at startup,
   value range is 0-3 with rising sensitivity.
+- interrupt-parent: should be the phandle for the interrupt controller
+- interrupts: interrupt mapping for IRQ
 
 Example:
 
@@ -17,4 +19,6 @@ pressure@77 {
        chip-id = <10>;
        temp-measurement-period = <100>;
        default-oversampling = <2>;
+       interrupt-parent = <&gpio0>;
+       interrupts = <25 IRQ_TYPE_EDGE_RISING>;
 };
index 8148a47fc70e17cbf76be1c6d88ad09f16c983b9..0091a8215ac150736346a669b5c822d70e5d02db 100644 (file)
@@ -149,7 +149,7 @@ linux-api@ver.kernel.org に送ることを勧めます。
      この他にパッチを作る方法についてのよくできた記述は-
 
        "The Perfect Patch"
-               http://userweb.kernel.org/~akpm/stuff/tpp.txt
+               http://www.ozlabs.org/~akpm/stuff/tpp.txt
        "Linux kernel patch submission format"
                http://linux.yyz.us/patch-format.html
 
@@ -622,7 +622,7 @@ Linux カーネルコミュニティは、一度に大量のコードの塊を
 これについて全てがどのようにあるべきかについての詳細は、以下のドキュメ
 ントの ChangeLog セクションを見てください-
   "The Perfect Patch"
-      http://userweb.kernel.org/~akpm/stuff/tpp.txt
+      http://www.ozlabs.org/~akpm/stuff/tpp.txt
 
 これらのどれもが、時にはとても困難です。これらの慣例を完璧に実施するに
 は数年かかるかもしれません。これは継続的な改善のプロセスであり、そのた
index 680e64635958a1be47e51948ce444f3838758595..d61a45acff4eae24433e028bd02e4c9cc6961eab 100644 (file)
@@ -122,7 +122,7 @@ mtk.manpages@gmail.com의 메인테이너에게 보낼 것을 권장한다.
 
     올바른 패치들을 만드는 법에 관한 훌륭한 다른 문서들이 있다.
     "The Perfect Patch"
-        http://userweb.kernel.org/~akpm/stuff/tpp.txt
+        http://www.ozlabs.org/~akpm/stuff/tpp.txt
     "Linux kernel patch submission format"
         http://linux.yyz.us/patch-format.html
 
@@ -597,7 +597,7 @@ Pat이라는 이름을 가진 여자가 있을 수도 있는 것이다. 리눅
 
 이것이 무엇인지 더 자세한 것을 알고 싶다면 다음 문서의 ChageLog 항을 봐라.
    "The Perfect Patch"
-    http://userweb.kernel.org/~akpm/stuff/tpp.txt
+    http://www.ozlabs.org/~akpm/stuff/tpp.txt
 
 
 
index 7fba5aab9ef9b8e846b9b282fc2165f83c8ffb4b..6c914aa87e7138086f7522ff4fc78acba564437c 100644 (file)
@@ -112,7 +112,7 @@ Linux内核代码中包含有大量的文档。这些文档对于学习如何与
 
     其他关于如何正确地生成补丁的优秀文档包括:
     "The Perfect Patch"
-        http://userweb.kernel.org/~akpm/stuff/tpp.txt
+        http://www.ozlabs.org/~akpm/stuff/tpp.txt
     "Linux kernel patch submission format"
         http://linux.yyz.us/patch-format.html
 
@@ -515,7 +515,7 @@ Linux内核社区并不喜欢一下接收大段的代码。修改需要被恰当
 
 想了解它具体应该看起来像什么,请查阅以下文档中的“ChangeLog”章节:
   “The Perfect Patch”
-        http://userweb.kernel.org/~akpm/stuff/tpp.txt
+        http://www.ozlabs.org/~akpm/stuff/tpp.txt
 
 
 这些事情有时候做起来很难。要在任何方面都做到完美可能需要好几年时间。这是
index d79d692d05b8f3c4a2d87e3422569ef084f365f8..896413b59aaea9d6f9c153181f4da742e04a8bf9 100644 (file)
@@ -735,7 +735,7 @@ static struct pci_device_id agp_amd64_pci_table[] = {
 
 MODULE_DEVICE_TABLE(pci, agp_amd64_pci_table);
 
-static DEFINE_PCI_DEVICE_TABLE(agp_amd64_pci_promisc_table) = {
+static const struct pci_device_id agp_amd64_pci_promisc_table[] = {
        { PCI_DEVICE_CLASS(0, 0) },
        { }
 };
index 3abfcecf84240b57b32f7253d1742dec178561d1..a7c16295b8161f30ea2578c29ce02084554d2097 100644 (file)
@@ -49,7 +49,7 @@ static int bmp085_i2c_probe(struct i2c_client *client,
                return err;
        }
 
-       return bmp085_probe(&client->dev, regmap);
+       return bmp085_probe(&client->dev, regmap, client->irq);
 }
 
 static int bmp085_i2c_remove(struct i2c_client *client)
index d6a52659cf24a7d15642545c7fab79915775fcff..864ecac323732aadb1feb27644140e443b978405 100644 (file)
@@ -41,7 +41,7 @@ static int bmp085_spi_probe(struct spi_device *client)
                return err;
        }
 
-       return bmp085_probe(&client->dev, regmap);
+       return bmp085_probe(&client->dev, regmap, client->irq);
 }
 
 static int bmp085_spi_remove(struct spi_device *client)
index 2704d885a9b30517cea14c91fda89d5e6748a64e..820e53d0048fa16e248ee41ce5b89987935fa9ac 100644 (file)
 #include <linux/device.h>
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/delay.h>
 #include <linux/of.h>
 #include "bmp085.h"
+#include <linux/interrupt.h>
+#include <linux/completion.h>
+#include <linux/gpio.h>
 
 #define BMP085_CHIP_ID                 0x55
 #define BMP085_CALIBRATION_DATA_START  0xAA
@@ -84,8 +86,19 @@ struct bmp085_data {
        unsigned long last_temp_measurement;
        u8      chip_id;
        s32     b6; /* calculated temperature correction coefficient */
+       int     irq;
+       struct  completion done;
 };
 
+static irqreturn_t bmp085_eoc_isr(int irq, void *devid)
+{
+       struct bmp085_data *data = devid;
+
+       complete(&data->done);
+
+       return IRQ_HANDLED;
+}
+
 static s32 bmp085_read_calibration_data(struct bmp085_data *data)
 {
        u16 tmp[BMP085_CALIBRATION_DATA_LENGTH];
@@ -116,6 +129,9 @@ static s32 bmp085_update_raw_temperature(struct bmp085_data *data)
        s32 status;
 
        mutex_lock(&data->lock);
+
+       init_completion(&data->done);
+
        status = regmap_write(data->regmap, BMP085_CTRL_REG,
                              BMP085_TEMP_MEASUREMENT);
        if (status < 0) {
@@ -123,7 +139,8 @@ static s32 bmp085_update_raw_temperature(struct bmp085_data *data)
                        "Error while requesting temperature measurement.\n");
                goto exit;
        }
-       msleep(BMP085_TEMP_CONVERSION_TIME);
+       wait_for_completion_timeout(&data->done, 1 + msecs_to_jiffies(
+                                           BMP085_TEMP_CONVERSION_TIME));
 
        status = regmap_bulk_read(data->regmap, BMP085_CONVERSION_REGISTER_MSB,
                                 &tmp, sizeof(tmp));
@@ -147,6 +164,9 @@ static s32 bmp085_update_raw_pressure(struct bmp085_data *data)
        s32 status;
 
        mutex_lock(&data->lock);
+
+       init_completion(&data->done);
+
        status = regmap_write(data->regmap, BMP085_CTRL_REG,
                        BMP085_PRESSURE_MEASUREMENT +
                        (data->oversampling_setting << 6));
@@ -157,8 +177,8 @@ static s32 bmp085_update_raw_pressure(struct bmp085_data *data)
        }
 
        /* wait for the end of conversion */
-       msleep(2+(3 << data->oversampling_setting));
-
+       wait_for_completion_timeout(&data->done, 1 + msecs_to_jiffies(
+                                       2+(3 << data->oversampling_setting)));
        /* copy data into a u32 (4 bytes), but skip the first byte. */
        status = regmap_bulk_read(data->regmap, BMP085_CONVERSION_REGISTER_MSB,
                                 ((u8 *)&tmp)+1, 3);
@@ -420,7 +440,7 @@ struct regmap_config bmp085_regmap_config = {
 };
 EXPORT_SYMBOL_GPL(bmp085_regmap_config);
 
-int bmp085_probe(struct device *dev, struct regmap *regmap)
+int bmp085_probe(struct device *dev, struct regmap *regmap, int irq)
 {
        struct bmp085_data *data;
        int err = 0;
@@ -434,6 +454,15 @@ int bmp085_probe(struct device *dev, struct regmap *regmap)
        dev_set_drvdata(dev, data);
        data->dev = dev;
        data->regmap = regmap;
+       data->irq = irq;
+
+       if (data->irq > 0) {
+               err = devm_request_irq(dev, data->irq, bmp085_eoc_isr,
+                                             IRQF_TRIGGER_RISING, "bmp085",
+                                             data);
+               if (err < 0)
+                       goto exit_free;
+       }
 
        /* Initialize the BMP085 chip */
        err = bmp085_init_client(data);
index 2b8f615bca92e5678cfe3182d6a9e513c5af5156..8b8e3b1f5ca5b05ba8d4b13d73adc69d1092f77c 100644 (file)
@@ -26,7 +26,7 @@
 
 extern struct regmap_config bmp085_regmap_config;
 
-int bmp085_probe(struct device *dev, struct regmap *regmap);
+int bmp085_probe(struct device *dev, struct regmap *regmap, int irq);
 int bmp085_remove(struct device *dev);
 int bmp085_detect(struct device *dev);
 
index 3a015abb444a826baecef6c6596f6a5c58adb648..78e55b501c94816a51b6ed7186c8473815b13689 100644 (file)
@@ -378,7 +378,6 @@ static int eeprom_93xx46_remove(struct spi_device *spi)
                device_remove_file(&spi->dev, &dev_attr_erase);
 
        sysfs_remove_bin_file(&spi->dev.kobj, &edev->bin);
-       spi_set_drvdata(spi, NULL);
        kfree(edev);
        return 0;
 }
index a2edb2ee0921657e188b89311673793bb2aa5fff..a9a203d5f8d98c0e7b9772a2cf801a63338a2f12 100644 (file)
@@ -334,9 +334,10 @@ static void execute_location(void *dst)
 
 static void execute_user_location(void *dst)
 {
+       /* Intentionally crossing kernel/user memory boundary. */
        void (*func)(void) = dst;
 
-       if (copy_to_user(dst, do_nothing, EXEC_SIZE))
+       if (copy_to_user((void __user *)dst, do_nothing, EXEC_SIZE))
                return;
        func();
 }
@@ -408,6 +409,8 @@ static void lkdtm_do_action(enum ctype which)
        case CT_SPINLOCKUP:
                /* Must be called twice to trigger. */
                spin_lock(&lock_me_up);
+               /* Let sparse know we intended to exit holding the lock. */
+               __release(&lock_me_up);
                break;
        case CT_HUNG_TASK:
                set_current_state(TASK_UNINTERRUPTIBLE);
index 87c96e4669e2c50fd9bb5889c813f3a35ce64b1f..6184e854ae1e19856b6ad9ed00744d199f604cb7 100644 (file)
@@ -344,8 +344,6 @@ int mei_cl_unlink(struct mei_cl *cl)
 
        cl->state = MEI_FILE_INITIALIZING;
 
-       list_del_init(&cl->link);
-
        return 0;
 }
 
index f7f3abbe12b6e2a8cc7058397ce77dc0c3cc7029..83c879bf9967be34e21ca6ebe87c789509de2e21 100644 (file)
@@ -131,6 +131,15 @@ err:
 }
 EXPORT_SYMBOL_GPL(mei_start);
 
+
+void mei_cancel_work(struct mei_device *dev)
+{
+       cancel_work_sync(&dev->init_work);
+
+       cancel_delayed_work(&dev->timer_work);
+}
+EXPORT_SYMBOL_GPL(mei_cancel_work);
+
 /**
  * mei_reset - resets host and fw.
  *
@@ -215,16 +224,14 @@ void mei_stop(struct mei_device *dev)
 {
        dev_dbg(&dev->pdev->dev, "stopping the device.\n");
 
-       flush_scheduled_work();
+       mei_cancel_work(dev);
 
-       mutex_lock(&dev->device_lock);
+       mei_nfc_host_exit(dev);
 
-       cancel_delayed_work(&dev->timer_work);
+       mutex_lock(&dev->device_lock);
 
        mei_wd_stop(dev);
 
-       mei_nfc_host_exit();
-
        dev->dev_state = MEI_DEV_POWER_DOWN;
        mei_reset(dev, 0);
 
index 7a95c07e59a6d675a4cc37a41c70fbd3e95961d7..9c8225b945c32276b720a2603df018a13dbc1a3d 100644 (file)
@@ -301,13 +301,11 @@ int mei_irq_read_handler(struct mei_device *dev,
                struct mei_cl_cb *cmpl_list, s32 *slots)
 {
        struct mei_msg_hdr *mei_hdr;
-       struct mei_cl *cl_pos = NULL;
-       struct mei_cl *cl_next = NULL;
-       int ret = 0;
+       struct mei_cl *cl;
+       int ret;
 
        if (!dev->rd_msg_hdr) {
                dev->rd_msg_hdr = mei_read_hdr(dev);
-               dev_dbg(&dev->pdev->dev, "slots =%08x.\n", *slots);
                (*slots)--;
                dev_dbg(&dev->pdev->dev, "slots =%08x.\n", *slots);
        }
@@ -315,61 +313,64 @@ int mei_irq_read_handler(struct mei_device *dev,
        dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr));
 
        if (mei_hdr->reserved || !dev->rd_msg_hdr) {
-               dev_dbg(&dev->pdev->dev, "corrupted message header.\n");
+               dev_err(&dev->pdev->dev, "corrupted message header 0x%08X\n",
+                               dev->rd_msg_hdr);
                ret = -EBADMSG;
                goto end;
        }
 
-       if (mei_hdr->host_addr || mei_hdr->me_addr) {
-               list_for_each_entry_safe(cl_pos, cl_next,
-                                       &dev->file_list, link) {
-                       dev_dbg(&dev->pdev->dev,
-                                       "list_for_each_entry_safe read host"
-                                       " client = %d, ME client = %d\n",
-                                       cl_pos->host_client_id,
-                                       cl_pos->me_client_id);
-                       if (mei_cl_hbm_equal(cl_pos, mei_hdr))
-                               break;
-               }
-
-               if (&cl_pos->link == &dev->file_list) {
-                       dev_dbg(&dev->pdev->dev, "corrupted message header\n");
-                       ret = -EBADMSG;
-                       goto end;
-               }
-       }
-       if (((*slots) * sizeof(u32)) < mei_hdr->length) {
-               dev_err(&dev->pdev->dev,
-                               "we can't read the message slots =%08x.\n",
+       if (mei_slots2data(*slots) < mei_hdr->length) {
+               dev_err(&dev->pdev->dev, "less data available than length=%08x.\n",
                                *slots);
                /* we can't read the message */
                ret = -ERANGE;
                goto end;
        }
 
-       /* decide where to read the message too */
-       if (!mei_hdr->host_addr) {
-               dev_dbg(&dev->pdev->dev, "call mei_hbm_dispatch.\n");
+       /*  HBM message */
+       if (mei_hdr->host_addr == 0 && mei_hdr->me_addr == 0) {
                mei_hbm_dispatch(dev, mei_hdr);
-               dev_dbg(&dev->pdev->dev, "end mei_hbm_dispatch.\n");
-       } else if (mei_hdr->host_addr == dev->iamthif_cl.host_client_id &&
-                  (MEI_FILE_CONNECTED == dev->iamthif_cl.state) &&
-                  (dev->iamthif_state == MEI_IAMTHIF_READING)) {
+               ret = 0;
+               dev_dbg(&dev->pdev->dev, "mei_hbm_dispatch.\n");
+               goto reset_slots;
+       }
 
-               dev_dbg(&dev->pdev->dev, "call mei_amthif_irq_read_msg.\n");
-               dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr));
+       /* find recepient cl */
+       list_for_each_entry(cl, &dev->file_list, link) {
+               if (mei_cl_hbm_equal(cl, mei_hdr)) {
+                       cl_dbg(dev, cl, "got a message\n");
+                       break;
+               }
+       }
+
+       /* if no recepient cl was found we assume corrupted header\n */
+       if (&cl->link == &dev->file_list) {
+               dev_err(&dev->pdev->dev, "no destination client found 0x%08X\n",
+                               dev->rd_msg_hdr);
+               ret = -EBADMSG;
+               goto end;
+       }
+
+       if (mei_hdr->host_addr == dev->iamthif_cl.host_client_id &&
+           MEI_FILE_CONNECTED == dev->iamthif_cl.state &&
+           dev->iamthif_state == MEI_IAMTHIF_READING) {
 
                ret = mei_amthif_irq_read_msg(dev, mei_hdr, cmpl_list);
-               if (ret)
+               if (ret) {
+                       dev_err(&dev->pdev->dev, "mei_amthif_irq_read_msg failed = %d\n",
+                                       ret);
                        goto end;
+               }
        } else {
-               dev_dbg(&dev->pdev->dev, "call mei_cl_irq_read_msg.\n");
-               dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr));
                ret = mei_cl_irq_read_msg(dev, mei_hdr, cmpl_list);
-               if (ret)
+               if (ret) {
+                       dev_err(&dev->pdev->dev, "mei_cl_irq_read_msg failed = %d\n",
+                                       ret);
                        goto end;
+               }
        }
 
+reset_slots:
        /* reset the number of slots and header */
        *slots = mei_count_full_read_slots(dev);
        dev->rd_msg_hdr = 0;
index 406f68e05b4ed4ccdbc6d9f886386a5d110e307b..4a7ee815fab1ffccce421024400386262aabb448 100644 (file)
@@ -456,6 +456,16 @@ static inline u32 mei_data2slots(size_t length)
        return DIV_ROUND_UP(sizeof(struct mei_msg_hdr) + length, 4);
 }
 
+/**
+ * mei_slots2data- get data in slots - bytes from slots
+ * @slots -  number of available slots
+ * returns  - number of bytes in slots
+ */
+static inline u32 mei_slots2data(int slots)
+{
+       return slots * 4;
+}
+
 /*
  * mei init function prototypes
  */
@@ -463,6 +473,7 @@ void mei_device_init(struct mei_device *dev);
 void mei_reset(struct mei_device *dev, int interrupts);
 int mei_start(struct mei_device *dev);
 void mei_stop(struct mei_device *dev);
+void mei_cancel_work(struct mei_device *dev);
 
 /*
  *  MEI interrupt functions prototype
@@ -510,7 +521,7 @@ int mei_amthif_irq_read(struct mei_device *dev, s32 *slots);
  * NFC functions
  */
 int mei_nfc_host_init(struct mei_device *dev);
-void mei_nfc_host_exit(void);
+void mei_nfc_host_exit(struct mei_device *dev);
 
 /*
  * NFC Client UUID
index 994ca4aff1a37ecf1b6fc53a2b44e1f446b710dd..0a892205ce7e6314fa53f8b9046f8a6d7e57206a 100644 (file)
@@ -547,12 +547,16 @@ err:
        return ret;
 }
 
-void mei_nfc_host_exit(void)
+void mei_nfc_host_exit(struct mei_device *dev)
 {
        struct mei_nfc_dev *ndev = &nfc_dev;
 
+       cancel_work_sync(&ndev->init_work);
+
+       mutex_lock(&dev->device_lock);
        if (ndev->cl && ndev->cl->device)
                mei_cl_remove_device(ndev->cl->device);
 
        mei_nfc_free(ndev);
+       mutex_unlock(&dev->device_lock);
 }
index 2cab3c0a6805364393e69a5410905874c4103e87..7dfaa328e5193bce166df861dc99d39ab86d617c 100644 (file)
@@ -197,8 +197,8 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        return 0;
 
 release_irq:
+       mei_cancel_work(dev);
        mei_disable_interrupts(dev);
-       flush_scheduled_work();
        free_irq(pdev->irq, dev);
 disable_msi:
        pci_disable_msi(pdev);
index 3574cc375bb95fc6699aef0296525250b9fcac8d..b2da289320c9cd95ee9d69a9362559f39ea4cb82 100644 (file)
@@ -134,6 +134,8 @@ struct mic_device {
  * @send_intr: Send an interrupt for a particular doorbell on the card.
  * @ack_interrupt: Hardware specific operations to ack the h/w on
  * receipt of an interrupt.
+ * @intr_workarounds: Hardware specific workarounds needed after
+ * handling an interrupt.
  * @reset: Reset the remote processor.
  * @reset_fw_ready: Reset firmware ready field.
  * @is_fw_ready: Check if firmware is ready for OS download.
@@ -149,6 +151,7 @@ struct mic_hw_ops {
        void (*write_spad)(struct mic_device *mdev, unsigned int idx, u32 val);
        void (*send_intr)(struct mic_device *mdev, int doorbell);
        u32 (*ack_interrupt)(struct mic_device *mdev);
+       void (*intr_workarounds)(struct mic_device *mdev);
        void (*reset)(struct mic_device *mdev);
        void (*reset_fw_ready)(struct mic_device *mdev);
        bool (*is_fw_ready)(struct mic_device *mdev);
index ad838c7651c46855872f25bd28d61a6ab80d8ab2..c04a021e20c776b3e87f6fe65517574249519586 100644 (file)
@@ -115,7 +115,7 @@ static irqreturn_t mic_shutdown_db(int irq, void *data)
        struct mic_device *mdev = data;
        struct mic_bootparam *bootparam = mdev->dp;
 
-       mdev->ops->ack_interrupt(mdev);
+       mdev->ops->intr_workarounds(mdev);
 
        switch (bootparam->shutdown_status) {
        case MIC_HALTED:
index e04bb4fe68235a7de2ac7e5c09c7c027776cb39c..752ff873f891bb3dc502305506f3f782ede28296 100644 (file)
@@ -369,7 +369,7 @@ static irqreturn_t mic_virtio_intr_handler(int irq, void *data)
        struct mic_vdev *mvdev = data;
        struct mic_device *mdev = mvdev->mdev;
 
-       mdev->ops->ack_interrupt(mdev);
+       mdev->ops->intr_workarounds(mdev);
        schedule_work(&mvdev->virtio_bh_work);
        return IRQ_HANDLED;
 }
index 0dfa8a81436e80ebd325d1722caa791d5193936e..5562fdd3ef4e56903d50a953aa70a0a21c9465ca 100644 (file)
@@ -174,35 +174,38 @@ static void mic_x100_send_intr(struct mic_device *mdev, int doorbell)
 }
 
 /**
- * mic_ack_interrupt - Device specific interrupt handling.
- * @mdev: pointer to mic_device instance
+ * mic_x100_ack_interrupt - Read the interrupt sources register and
+ * clear it. This function will be called in the MSI/INTx case.
+ * @mdev: Pointer to mic_device instance.
  *
- * Returns: bitmask of doorbell events triggered.
+ * Returns: bitmask of interrupt sources triggered.
  */
 static u32 mic_x100_ack_interrupt(struct mic_device *mdev)
 {
-       u32 reg = 0;
-       struct mic_mw *mw = &mdev->mmio;
        u32 sicr0 = MIC_X100_SBOX_BASE_ADDRESS + MIC_X100_SBOX_SICR0;
+       u32 reg = mic_mmio_read(&mdev->mmio, sicr0);
+       mic_mmio_write(&mdev->mmio, reg, sicr0);
+       return reg;
+}
+
+/**
+ * mic_x100_intr_workarounds - These hardware specific workarounds are
+ * to be invoked everytime an interrupt is handled.
+ * @mdev: Pointer to mic_device instance.
+ *
+ * Returns: none
+ */
+static void mic_x100_intr_workarounds(struct mic_device *mdev)
+{
+       struct mic_mw *mw = &mdev->mmio;
 
        /* Clear pending bit array. */
        if (MIC_A0_STEP == mdev->stepping)
                mic_mmio_write(mw, 1, MIC_X100_SBOX_BASE_ADDRESS +
                        MIC_X100_SBOX_MSIXPBACR);
 
-       if (mdev->irq_info.num_vectors <= 1) {
-               reg = mic_mmio_read(mw, sicr0);
-
-               if (unlikely(!reg))
-                       goto done;
-
-               mic_mmio_write(mw, reg, sicr0);
-       }
-
        if (mdev->stepping >= MIC_B0_STEP)
                mdev->intr_ops->enable_interrupts(mdev);
-done:
-       return reg;
 }
 
 /**
@@ -553,6 +556,7 @@ struct mic_hw_ops mic_x100_ops = {
        .write_spad = mic_x100_write_spad,
        .send_intr = mic_x100_send_intr,
        .ack_interrupt = mic_x100_ack_interrupt,
+       .intr_workarounds = mic_x100_intr_workarounds,
        .reset = mic_x100_hw_reset,
        .reset_fw_ready = mic_x100_reset_fw_ready,
        .is_fw_ready = mic_x100_is_fw_ready,
index 8d64b681dd9326c830e9d67a3ccf6d11f6e0ab87..3aed525e55b48bee7303715c55dea5f162f23752 100644 (file)
@@ -812,7 +812,7 @@ static void st_tty_flush_buffer(struct tty_struct *tty)
        kfree_skb(st_gdata->tx_skb);
        st_gdata->tx_skb = NULL;
 
-       tty->ops->flush_buffer(tty);
+       tty_driver_flush_buffer(tty);
        return;
 }
 
index 96853a09788a9a76b15da513007c359c0fd42e0b..9d3dbb28734b9fd29c99de4eff7c9dccd7041024 100644 (file)
@@ -531,7 +531,6 @@ long st_kim_stop(void *kim_data)
                /* Flush any pending characters in the driver and discipline. */
                tty_ldisc_flush(tty);
                tty_driver_flush_buffer(tty);
-               tty->ops->flush_buffer(tty);
        }
 
        /* send uninstall notification to UIM */
index 9637615262296235737a094282645b72f3c6ccc5..76ee7750bc5ec29352c70b50a23811f73364b09a 100644 (file)
@@ -2600,8 +2600,6 @@ enum parport_pc_pci_cards {
        syba_2p_epp,
        syba_1p_ecp,
        titan_010l,
-       titan_1284p1,
-       titan_1284p2,
        avlab_1p,
        avlab_2p,
        oxsemi_952,
@@ -2660,8 +2658,6 @@ static struct parport_pc_pci {
        /* syba_2p_epp AP138B */        { 2, { { 0, 0x078 }, { 0, 0x178 }, } },
        /* syba_1p_ecp W83787 */        { 1, { { 0, 0x078 }, } },
        /* titan_010l */                { 1, { { 3, -1 }, } },
-       /* titan_1284p1 */              { 1, { { 0, 1 }, } },
-       /* titan_1284p2 */              { 2, { { 0, 1 }, { 2, 3 }, } },
        /* avlab_1p             */      { 1, { { 0, 1}, } },
        /* avlab_2p             */      { 2, { { 0, 1}, { 2, 3 },} },
        /* The Oxford Semi cards are unusual: 954 doesn't support ECP,
@@ -2677,8 +2673,8 @@ static struct parport_pc_pci {
        /* netmos_9705 */               { 1, { { 0, -1 }, } },
        /* netmos_9715 */               { 2, { { 0, 1 }, { 2, 3 },} },
        /* netmos_9755 */               { 2, { { 0, 1 }, { 2, 3 },} },
-       /* netmos_9805 */               { 1, { { 0, -1 }, } },
-       /* netmos_9815 */               { 2, { { 0, -1 }, { 2, -1 }, } },
+       /* netmos_9805 */               { 1, { { 0, 1 }, } },
+       /* netmos_9815 */               { 2, { { 0, 1 }, { 2, 3 }, } },
        /* netmos_9901 */               { 1, { { 0, -1 }, } },
        /* netmos_9865 */               { 1, { { 0, -1 }, } },
        /* quatech_sppxp100 */          { 1, { { 0, 1 }, } },
@@ -2722,8 +2718,6 @@ static const struct pci_device_id parport_pc_pci_tbl[] = {
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, syba_1p_ecp },
        { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_010L,
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, titan_010l },
-       { 0x9710, 0x9805, 0x1000, 0x0010, 0, 0, titan_1284p1 },
-       { 0x9710, 0x9815, 0x1000, 0x0020, 0, 0, titan_1284p2 },
        /* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/
        /* AFAVLAB_TK9902 */
        { 0x14db, 0x2120, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1p},
@@ -2827,16 +2821,12 @@ static int parport_pc_pci_probe(struct pci_dev *dev,
                if (irq == IRQ_NONE) {
                        printk(KERN_DEBUG
        "PCI parallel port detected: %04x:%04x, I/O at %#lx(%#lx)\n",
-                               parport_pc_pci_tbl[i + last_sio].vendor,
-                               parport_pc_pci_tbl[i + last_sio].device,
-                               io_lo, io_hi);
+                               id->vendor, id->device, io_lo, io_hi);
                        irq = PARPORT_IRQ_NONE;
                } else {
                        printk(KERN_DEBUG
        "PCI parallel port detected: %04x:%04x, I/O at %#lx(%#lx), IRQ %d\n",
-                               parport_pc_pci_tbl[i + last_sio].vendor,
-                               parport_pc_pci_tbl[i + last_sio].device,
-                               io_lo, io_hi, irq);
+                               id->vendor, id->device, io_lo, io_hi, irq);
                }
                data->ports[count] =
                        parport_pc_probe_port(io_lo, io_hi, irq,
@@ -2866,8 +2856,6 @@ static void parport_pc_pci_remove(struct pci_dev *dev)
        struct pci_parport_data *data = pci_get_drvdata(dev);
        int i;
 
-       pci_set_drvdata(dev, NULL);
-
        if (data) {
                for (i = data->num - 1; i >= 0; i--)
                        parport_pc_unregister_port(data->ports[i]);
index ed3b522601b3a422af5eeea61e25671577116c73..971991bab975a2ec0c91ab2724b9dd8c7f9cb90d 100644 (file)
@@ -303,7 +303,7 @@ static int bfin_cf_remove(struct platform_device *pdev)
 
 static struct platform_driver bfin_cf_driver = {
        .driver = {
-                  .name = (char *)driver_name,
+                  .name = driver_name,
                   .owner = THIS_MODULE,
                   },
        .probe = bfin_cf_probe,
index 1b206eac5f93be86ffe61d07bf420d2234a79cae..5ea64d0f61abf87bd6c7767083b2dec4e52447fc 100644 (file)
@@ -359,7 +359,7 @@ MODULE_DEVICE_TABLE(of, electra_cf_match);
 
 static struct platform_driver electra_cf_driver = {
        .driver = {
-               .name = (char *)driver_name,
+               .name = driver_name,
                .owner = THIS_MODULE,
                .of_match_table = electra_cf_match,
        },
index f764adbfe036861dfccbada4ac9f27152e2f88aa..d1f95a1567bba0a3f598538d5e11dca8308b7f82 100644 (file)
@@ -228,7 +228,7 @@ static void mf624_pci_remove(struct pci_dev *dev)
        kfree(info);
 }
 
-static DEFINE_PCI_DEVICE_TABLE(mf624_pci_id) = {
+static const struct pci_device_id mf624_pci_id[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_HUMUSOFT, PCI_DEVICE_ID_MF624) },
        { 0, }
 };
index 15c7251b05563d5cbef5df2aeca278dd4f4a8502..1e5d94c5afc9668af993bacbdcc2ea8a6e1de497 100644 (file)
@@ -46,7 +46,6 @@
 
 struct mxc_w1_device {
        void __iomem *regs;
-       unsigned int clkdiv;
        struct clk *clk;
        struct w1_bus_master bus_master;
 };
@@ -106,8 +105,10 @@ static u8 mxc_w1_ds2_touch_bit(void *data, u8 bit)
 static int mxc_w1_probe(struct platform_device *pdev)
 {
        struct mxc_w1_device *mdev;
+       unsigned long clkrate;
        struct resource *res;
-       int err = 0;
+       unsigned int clkdiv;
+       int err;
 
        mdev = devm_kzalloc(&pdev->dev, sizeof(struct mxc_w1_device),
                            GFP_KERNEL);
@@ -118,27 +119,39 @@ static int mxc_w1_probe(struct platform_device *pdev)
        if (IS_ERR(mdev->clk))
                return PTR_ERR(mdev->clk);
 
-       mdev->clkdiv = (clk_get_rate(mdev->clk) / 1000000) - 1;
+       clkrate = clk_get_rate(mdev->clk);
+       if (clkrate < 10000000)
+               dev_warn(&pdev->dev,
+                        "Low clock frequency causes improper function\n");
+
+       clkdiv = DIV_ROUND_CLOSEST(clkrate, 1000000);
+       clkrate /= clkdiv;
+       if ((clkrate < 980000) || (clkrate > 1020000))
+               dev_warn(&pdev->dev,
+                        "Incorrect time base frequency %lu Hz\n", clkrate);
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        mdev->regs = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(mdev->regs))
                return PTR_ERR(mdev->regs);
 
-       clk_prepare_enable(mdev->clk);
-       __raw_writeb(mdev->clkdiv, mdev->regs + MXC_W1_TIME_DIVIDER);
+       err = clk_prepare_enable(mdev->clk);
+       if (err)
+               return err;
+
+       __raw_writeb(clkdiv - 1, mdev->regs + MXC_W1_TIME_DIVIDER);
 
        mdev->bus_master.data = mdev;
        mdev->bus_master.reset_bus = mxc_w1_ds2_reset_bus;
        mdev->bus_master.touch_bit = mxc_w1_ds2_touch_bit;
 
-       err = w1_add_master_device(&mdev->bus_master);
+       platform_set_drvdata(pdev, mdev);
 
+       err = w1_add_master_device(&mdev->bus_master);
        if (err)
-               return err;
+               clk_disable_unprepare(mdev->clk);
 
-       platform_set_drvdata(pdev, mdev);
-       return 0;
+       return err;
 }
 
 /*
index b8d6d541d854b7d719056cec96640548980eb79e..4088b816a3eeac3c513400a67901337a529effd0 100644 (file)
@@ -26,7 +26,6 @@
 #include <sys/socket.h>
 #include <sys/poll.h>
 #include <sys/utsname.h>
-#include <linux/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
index 8bcb04096eb267a1f6d49e672720661e779ec5c3..520de330457106657ab747581f983d23d695e5df 100644 (file)
@@ -22,7 +22,6 @@
 #include <sys/socket.h>
 #include <sys/poll.h>
 #include <sys/ioctl.h>
-#include <linux/types.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <mntent.h>