diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-17 19:15:17 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-17 19:15:17 -0400 |
| commit | 11634bd6682d5979fa10fdc01cd74577827377bd (patch) | |
| tree | 22e3a3e7439ba30b15498113d24017b89e58cd39 | |
| parent | 1d9dbf154295aa33819b08340464ff15495e83d8 (diff) | |
| parent | 4cf465b579c20bee868464f5d664f8d2d96cd370 (diff) | |
Merge branches 'acpi-scan' and 'acpi-video'
* acpi-scan:
ACPI / documentation: Remove reference to acpi_platform_device_ids from enumeration.txt
* acpi-video:
ACPI / video: Add use_native_backlight quirk for HP ProBook 4540s
Revert "ACPI / video: change acpi-video brightness_switch_enabled default to 0"
204 files changed, 1633 insertions, 788 deletions
diff --git a/Documentation/Changes b/Documentation/Changes index 2254db0f00a5..227bec88021e 100644 --- a/Documentation/Changes +++ b/Documentation/Changes | |||
| @@ -280,12 +280,9 @@ that is possible. | |||
| 280 | mcelog | 280 | mcelog |
| 281 | ------ | 281 | ------ |
| 282 | 282 | ||
| 283 | In Linux 2.6.31+ the i386 kernel needs to run the mcelog utility | 283 | On x86 kernels the mcelog utility is needed to process and log machine check |
| 284 | as a regular cronjob similar to the x86-64 kernel to process and log | 284 | events when CONFIG_X86_MCE is enabled. Machine check events are errors reported |
| 285 | machine check events when CONFIG_X86_NEW_MCE is enabled. Machine check | 285 | by the CPU. Processing them is strongly encouraged. |
| 286 | events are errors reported by the CPU. Processing them is strongly encouraged. | ||
| 287 | All x86-64 kernels since 2.6.4 require the mcelog utility to | ||
| 288 | process machine checks. | ||
| 289 | 286 | ||
| 290 | Getting updated software | 287 | Getting updated software |
| 291 | ======================== | 288 | ======================== |
diff --git a/Documentation/DocBook/gadget.tmpl b/Documentation/DocBook/gadget.tmpl index 4017f147ba2f..2c425d70f7e2 100644 --- a/Documentation/DocBook/gadget.tmpl +++ b/Documentation/DocBook/gadget.tmpl | |||
| @@ -708,7 +708,7 @@ hardware level details could be very different. | |||
| 708 | 708 | ||
| 709 | <para>Systems need specialized hardware support to implement OTG, | 709 | <para>Systems need specialized hardware support to implement OTG, |
| 710 | notably including a special <emphasis>Mini-AB</emphasis> jack | 710 | notably including a special <emphasis>Mini-AB</emphasis> jack |
| 711 | and associated transciever to support <emphasis>Dual-Role</emphasis> | 711 | and associated transceiver to support <emphasis>Dual-Role</emphasis> |
| 712 | operation: | 712 | operation: |
| 713 | they can act either as a host, using the standard | 713 | they can act either as a host, using the standard |
| 714 | Linux-USB host side driver stack, | 714 | Linux-USB host side driver stack, |
diff --git a/Documentation/DocBook/genericirq.tmpl b/Documentation/DocBook/genericirq.tmpl index 46347f603353..59fb5c077541 100644 --- a/Documentation/DocBook/genericirq.tmpl +++ b/Documentation/DocBook/genericirq.tmpl | |||
| @@ -182,7 +182,7 @@ | |||
| 182 | <para> | 182 | <para> |
| 183 | Each interrupt is described by an interrupt descriptor structure | 183 | Each interrupt is described by an interrupt descriptor structure |
| 184 | irq_desc. The interrupt is referenced by an 'unsigned int' numeric | 184 | irq_desc. The interrupt is referenced by an 'unsigned int' numeric |
| 185 | value which selects the corresponding interrupt decription structure | 185 | value which selects the corresponding interrupt description structure |
| 186 | in the descriptor structures array. | 186 | in the descriptor structures array. |
| 187 | The descriptor structure contains status information and pointers | 187 | The descriptor structure contains status information and pointers |
| 188 | to the interrupt flow method and the interrupt chip structure | 188 | to the interrupt flow method and the interrupt chip structure |
| @@ -470,7 +470,7 @@ if (desc->irq_data.chip->irq_eoi) | |||
| 470 | <para> | 470 | <para> |
| 471 | To avoid copies of identical implementations of IRQ chips the | 471 | To avoid copies of identical implementations of IRQ chips the |
| 472 | core provides a configurable generic interrupt chip | 472 | core provides a configurable generic interrupt chip |
| 473 | implementation. Developers should check carefuly whether the | 473 | implementation. Developers should check carefully whether the |
| 474 | generic chip fits their needs before implementing the same | 474 | generic chip fits their needs before implementing the same |
| 475 | functionality slightly differently themselves. | 475 | functionality slightly differently themselves. |
| 476 | </para> | 476 | </para> |
diff --git a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl index 19f2a5a5a5b4..e584ee12a1e7 100644 --- a/Documentation/DocBook/kernel-locking.tmpl +++ b/Documentation/DocBook/kernel-locking.tmpl | |||
| @@ -1760,7 +1760,7 @@ as it would be on UP. | |||
| 1760 | </para> | 1760 | </para> |
| 1761 | 1761 | ||
| 1762 | <para> | 1762 | <para> |
| 1763 | There is a furthur optimization possible here: remember our original | 1763 | There is a further optimization possible here: remember our original |
| 1764 | cache code, where there were no reference counts and the caller simply | 1764 | cache code, where there were no reference counts and the caller simply |
| 1765 | held the lock whenever using the object? This is still possible: if | 1765 | held the lock whenever using the object? This is still possible: if |
| 1766 | you hold the lock, no one can delete the object, so you don't need to | 1766 | you hold the lock, no one can delete the object, so you don't need to |
diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl index deb71baed328..d7fcdc5a4379 100644 --- a/Documentation/DocBook/libata.tmpl +++ b/Documentation/DocBook/libata.tmpl | |||
| @@ -677,7 +677,7 @@ and other resources, etc. | |||
| 677 | 677 | ||
| 678 | <listitem> | 678 | <listitem> |
| 679 | <para> | 679 | <para> |
| 680 | ATA_QCFLAG_ACTIVE is clared from qc->flags. | 680 | ATA_QCFLAG_ACTIVE is cleared from qc->flags. |
| 681 | </para> | 681 | </para> |
| 682 | </listitem> | 682 | </listitem> |
| 683 | 683 | ||
| @@ -708,7 +708,7 @@ and other resources, etc. | |||
| 708 | 708 | ||
| 709 | <listitem> | 709 | <listitem> |
| 710 | <para> | 710 | <para> |
| 711 | qc->waiting is claread & completed (in that order). | 711 | qc->waiting is cleared & completed (in that order). |
| 712 | </para> | 712 | </para> |
| 713 | </listitem> | 713 | </listitem> |
| 714 | 714 | ||
| @@ -1163,7 +1163,7 @@ and other resources, etc. | |||
| 1163 | 1163 | ||
| 1164 | <para> | 1164 | <para> |
| 1165 | Once sense data is acquired, this type of errors can be | 1165 | Once sense data is acquired, this type of errors can be |
| 1166 | handled similary to other SCSI errors. Note that sense data | 1166 | handled similarly to other SCSI errors. Note that sense data |
| 1167 | may indicate ATA bus error (e.g. Sense Key 04h HARDWARE ERROR | 1167 | may indicate ATA bus error (e.g. Sense Key 04h HARDWARE ERROR |
| 1168 | && ASC/ASCQ 47h/00h SCSI PARITY ERROR). In such | 1168 | && ASC/ASCQ 47h/00h SCSI PARITY ERROR). In such |
| 1169 | cases, the error should be considered as an ATA bus error and | 1169 | cases, the error should be considered as an ATA bus error and |
diff --git a/Documentation/DocBook/media_api.tmpl b/Documentation/DocBook/media_api.tmpl index 4decb46bfa76..03f9a1f8d413 100644 --- a/Documentation/DocBook/media_api.tmpl +++ b/Documentation/DocBook/media_api.tmpl | |||
| @@ -68,7 +68,7 @@ | |||
| 68 | several digital tv standards. While it is called as DVB API, | 68 | several digital tv standards. While it is called as DVB API, |
| 69 | in fact it covers several different video standards including | 69 | in fact it covers several different video standards including |
| 70 | DVB-T, DVB-S, DVB-C and ATSC. The API is currently being updated | 70 | DVB-T, DVB-S, DVB-C and ATSC. The API is currently being updated |
| 71 | to documment support also for DVB-S2, ISDB-T and ISDB-S.</para> | 71 | to document support also for DVB-S2, ISDB-T and ISDB-S.</para> |
| 72 | <para>The third part covers the Remote Controller API.</para> | 72 | <para>The third part covers the Remote Controller API.</para> |
| 73 | <para>The fourth part covers the Media Controller API.</para> | 73 | <para>The fourth part covers the Media Controller API.</para> |
| 74 | <para>For additional information and for the latest development code, | 74 | <para>For additional information and for the latest development code, |
diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl index cd11926e07c7..7da8f0402af5 100644 --- a/Documentation/DocBook/mtdnand.tmpl +++ b/Documentation/DocBook/mtdnand.tmpl | |||
| @@ -91,7 +91,7 @@ | |||
| 91 | <listitem><para> | 91 | <listitem><para> |
| 92 | [MTD Interface]</para><para> | 92 | [MTD Interface]</para><para> |
| 93 | These functions provide the interface to the MTD kernel API. | 93 | These functions provide the interface to the MTD kernel API. |
| 94 | They are not replacable and provide functionality | 94 | They are not replaceable and provide functionality |
| 95 | which is complete hardware independent. | 95 | which is complete hardware independent. |
| 96 | </para></listitem> | 96 | </para></listitem> |
| 97 | <listitem><para> | 97 | <listitem><para> |
| @@ -100,14 +100,14 @@ | |||
| 100 | </para></listitem> | 100 | </para></listitem> |
| 101 | <listitem><para> | 101 | <listitem><para> |
| 102 | [GENERIC]</para><para> | 102 | [GENERIC]</para><para> |
| 103 | Generic functions are not replacable and provide functionality | 103 | Generic functions are not replaceable and provide functionality |
| 104 | which is complete hardware independent. | 104 | which is complete hardware independent. |
| 105 | </para></listitem> | 105 | </para></listitem> |
| 106 | <listitem><para> | 106 | <listitem><para> |
| 107 | [DEFAULT]</para><para> | 107 | [DEFAULT]</para><para> |
| 108 | Default functions provide hardware related functionality which is suitable | 108 | Default functions provide hardware related functionality which is suitable |
| 109 | for most of the implementations. These functions can be replaced by the | 109 | for most of the implementations. These functions can be replaced by the |
| 110 | board driver if neccecary. Those functions are called via pointers in the | 110 | board driver if necessary. Those functions are called via pointers in the |
| 111 | NAND chip description structure. The board driver can set the functions which | 111 | NAND chip description structure. The board driver can set the functions which |
| 112 | should be replaced by board dependent functions before calling nand_scan(). | 112 | should be replaced by board dependent functions before calling nand_scan(). |
| 113 | If the function pointer is NULL on entry to nand_scan() then the pointer | 113 | If the function pointer is NULL on entry to nand_scan() then the pointer |
| @@ -264,7 +264,7 @@ static void board_hwcontrol(struct mtd_info *mtd, int cmd) | |||
| 264 | is set up nand_scan() is called. This function tries to | 264 | is set up nand_scan() is called. This function tries to |
| 265 | detect and identify then chip. If a chip is found all the | 265 | detect and identify then chip. If a chip is found all the |
| 266 | internal data fields are initialized accordingly. | 266 | internal data fields are initialized accordingly. |
| 267 | The structure(s) have to be zeroed out first and then filled with the neccecary | 267 | The structure(s) have to be zeroed out first and then filled with the necessary |
| 268 | information about the device. | 268 | information about the device. |
| 269 | </para> | 269 | </para> |
| 270 | <programlisting> | 270 | <programlisting> |
| @@ -327,7 +327,7 @@ module_init(board_init); | |||
| 327 | <sect1 id="Exit_function"> | 327 | <sect1 id="Exit_function"> |
| 328 | <title>Exit function</title> | 328 | <title>Exit function</title> |
| 329 | <para> | 329 | <para> |
| 330 | The exit function is only neccecary if the driver is | 330 | The exit function is only necessary if the driver is |
| 331 | compiled as a module. It releases all resources which | 331 | compiled as a module. It releases all resources which |
| 332 | are held by the chip driver and unregisters the partitions | 332 | are held by the chip driver and unregisters the partitions |
| 333 | in the MTD layer. | 333 | in the MTD layer. |
| @@ -494,7 +494,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) | |||
| 494 | in this case. See rts_from4.c and diskonchip.c for | 494 | in this case. See rts_from4.c and diskonchip.c for |
| 495 | implementation reference. In those cases we must also | 495 | implementation reference. In those cases we must also |
| 496 | use bad block tables on FLASH, because the ECC layout is | 496 | use bad block tables on FLASH, because the ECC layout is |
| 497 | interferring with the bad block marker positions. | 497 | interfering with the bad block marker positions. |
| 498 | See bad block table support for details. | 498 | See bad block table support for details. |
| 499 | </para> | 499 | </para> |
| 500 | </sect2> | 500 | </sect2> |
| @@ -542,7 +542,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) | |||
| 542 | <para> | 542 | <para> |
| 543 | nand_scan() calls the function nand_default_bbt(). | 543 | nand_scan() calls the function nand_default_bbt(). |
| 544 | nand_default_bbt() selects appropriate default | 544 | nand_default_bbt() selects appropriate default |
| 545 | bad block table desriptors depending on the chip information | 545 | bad block table descriptors depending on the chip information |
| 546 | which was retrieved by nand_scan(). | 546 | which was retrieved by nand_scan(). |
| 547 | </para> | 547 | </para> |
| 548 | <para> | 548 | <para> |
| @@ -554,7 +554,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) | |||
| 554 | <sect2 id="Flash_based_tables"> | 554 | <sect2 id="Flash_based_tables"> |
| 555 | <title>Flash based tables</title> | 555 | <title>Flash based tables</title> |
| 556 | <para> | 556 | <para> |
| 557 | It may be desired or neccecary to keep a bad block table in FLASH. | 557 | It may be desired or necessary to keep a bad block table in FLASH. |
| 558 | For AG-AND chips this is mandatory, as they have no factory marked | 558 | For AG-AND chips this is mandatory, as they have no factory marked |
| 559 | bad blocks. They have factory marked good blocks. The marker pattern | 559 | bad blocks. They have factory marked good blocks. The marker pattern |
| 560 | is erased when the block is erased to be reused. So in case of | 560 | is erased when the block is erased to be reused. So in case of |
| @@ -565,10 +565,10 @@ static void board_select_chip (struct mtd_info *mtd, int chip) | |||
| 565 | of the blocks. | 565 | of the blocks. |
| 566 | </para> | 566 | </para> |
| 567 | <para> | 567 | <para> |
| 568 | The blocks in which the tables are stored are procteted against | 568 | The blocks in which the tables are stored are protected against |
| 569 | accidental access by marking them bad in the memory bad block | 569 | accidental access by marking them bad in the memory bad block |
| 570 | table. The bad block table management functions are allowed | 570 | table. The bad block table management functions are allowed |
| 571 | to circumvernt this protection. | 571 | to circumvent this protection. |
| 572 | </para> | 572 | </para> |
| 573 | <para> | 573 | <para> |
| 574 | The simplest way to activate the FLASH based bad block table support | 574 | The simplest way to activate the FLASH based bad block table support |
| @@ -592,7 +592,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) | |||
| 592 | User defined tables are created by filling out a | 592 | User defined tables are created by filling out a |
| 593 | nand_bbt_descr structure and storing the pointer in the | 593 | nand_bbt_descr structure and storing the pointer in the |
| 594 | nand_chip structure member bbt_td before calling nand_scan(). | 594 | nand_chip structure member bbt_td before calling nand_scan(). |
| 595 | If a mirror table is neccecary a second structure must be | 595 | If a mirror table is necessary a second structure must be |
| 596 | created and a pointer to this structure must be stored | 596 | created and a pointer to this structure must be stored |
| 597 | in bbt_md inside the nand_chip structure. If the bbt_md | 597 | in bbt_md inside the nand_chip structure. If the bbt_md |
| 598 | member is set to NULL then only the main table is used | 598 | member is set to NULL then only the main table is used |
| @@ -666,7 +666,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) | |||
| 666 | <para> | 666 | <para> |
| 667 | For automatic placement some blocks must be reserved for | 667 | For automatic placement some blocks must be reserved for |
| 668 | bad block table storage. The number of reserved blocks is defined | 668 | bad block table storage. The number of reserved blocks is defined |
| 669 | in the maxblocks member of the babd block table description structure. | 669 | in the maxblocks member of the bad block table description structure. |
| 670 | Reserving 4 blocks for mirrored tables should be a reasonable number. | 670 | Reserving 4 blocks for mirrored tables should be a reasonable number. |
| 671 | This also limits the number of blocks which are scanned for the bad | 671 | This also limits the number of blocks which are scanned for the bad |
| 672 | block table ident pattern. | 672 | block table ident pattern. |
| @@ -1068,11 +1068,11 @@ in this page</entry> | |||
| 1068 | <chapter id="filesystems"> | 1068 | <chapter id="filesystems"> |
| 1069 | <title>Filesystem support</title> | 1069 | <title>Filesystem support</title> |
| 1070 | <para> | 1070 | <para> |
| 1071 | The NAND driver provides all neccecary functions for a | 1071 | The NAND driver provides all necessary functions for a |
| 1072 | filesystem via the MTD interface. | 1072 | filesystem via the MTD interface. |
| 1073 | </para> | 1073 | </para> |
| 1074 | <para> | 1074 | <para> |
| 1075 | Filesystems must be aware of the NAND pecularities and | 1075 | Filesystems must be aware of the NAND peculiarities and |
| 1076 | restrictions. One major restrictions of NAND Flash is, that you cannot | 1076 | restrictions. One major restrictions of NAND Flash is, that you cannot |
| 1077 | write as often as you want to a page. The consecutive writes to a page, | 1077 | write as often as you want to a page. The consecutive writes to a page, |
| 1078 | before erasing it again, are restricted to 1-3 writes, depending on the | 1078 | before erasing it again, are restricted to 1-3 writes, depending on the |
| @@ -1222,7 +1222,7 @@ in this page</entry> | |||
| 1222 | #define NAND_BBT_VERSION 0x00000100 | 1222 | #define NAND_BBT_VERSION 0x00000100 |
| 1223 | /* Create a bbt if none axists */ | 1223 | /* Create a bbt if none axists */ |
| 1224 | #define NAND_BBT_CREATE 0x00000200 | 1224 | #define NAND_BBT_CREATE 0x00000200 |
| 1225 | /* Write bbt if neccecary */ | 1225 | /* Write bbt if necessary */ |
| 1226 | #define NAND_BBT_WRITE 0x00001000 | 1226 | #define NAND_BBT_WRITE 0x00001000 |
| 1227 | /* Read and write back block contents when writing bbt */ | 1227 | /* Read and write back block contents when writing bbt */ |
| 1228 | #define NAND_BBT_SAVECONTENT 0x00002000 | 1228 | #define NAND_BBT_SAVECONTENT 0x00002000 |
diff --git a/Documentation/DocBook/regulator.tmpl b/Documentation/DocBook/regulator.tmpl index 346e552fa2cc..3b08a085d2c7 100644 --- a/Documentation/DocBook/regulator.tmpl +++ b/Documentation/DocBook/regulator.tmpl | |||
| @@ -155,7 +155,7 @@ | |||
| 155 | release regulators. Functions are | 155 | release regulators. Functions are |
| 156 | provided to <link linkend='API-regulator-enable'>enable</link> | 156 | provided to <link linkend='API-regulator-enable'>enable</link> |
| 157 | and <link linkend='API-regulator-disable'>disable</link> the | 157 | and <link linkend='API-regulator-disable'>disable</link> the |
| 158 | reguator and to get and set the runtime parameters of the | 158 | regulator and to get and set the runtime parameters of the |
| 159 | regulator. | 159 | regulator. |
| 160 | </para> | 160 | </para> |
| 161 | <para> | 161 | <para> |
diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl index 95618159e29b..bbe9c1fd5cef 100644 --- a/Documentation/DocBook/uio-howto.tmpl +++ b/Documentation/DocBook/uio-howto.tmpl | |||
| @@ -766,10 +766,10 @@ framework to set up sysfs files for this region. Simply leave it alone. | |||
| 766 | <para> | 766 | <para> |
| 767 | The dynamic memory regions will be allocated when the UIO device file, | 767 | The dynamic memory regions will be allocated when the UIO device file, |
| 768 | <varname>/dev/uioX</varname> is opened. | 768 | <varname>/dev/uioX</varname> is opened. |
| 769 | Simiar to static memory resources, the memory region information for | 769 | Similar to static memory resources, the memory region information for |
| 770 | dynamic regions is then visible via sysfs at | 770 | dynamic regions is then visible via sysfs at |
| 771 | <varname>/sys/class/uio/uioX/maps/mapY/*</varname>. | 771 | <varname>/sys/class/uio/uioX/maps/mapY/*</varname>. |
| 772 | The dynmaic memory regions will be freed when the UIO device file is | 772 | The dynamic memory regions will be freed when the UIO device file is |
| 773 | closed. When no processes are holding the device file open, the address | 773 | closed. When no processes are holding the device file open, the address |
| 774 | returned to userspace is ~0. | 774 | returned to userspace is ~0. |
| 775 | </para> | 775 | </para> |
diff --git a/Documentation/DocBook/usb.tmpl b/Documentation/DocBook/usb.tmpl index 8d57c1888dca..85fc0e28576f 100644 --- a/Documentation/DocBook/usb.tmpl +++ b/Documentation/DocBook/usb.tmpl | |||
| @@ -153,7 +153,7 @@ | |||
| 153 | 153 | ||
| 154 | <listitem><para>The Linux USB API supports synchronous calls for | 154 | <listitem><para>The Linux USB API supports synchronous calls for |
| 155 | control and bulk messages. | 155 | control and bulk messages. |
| 156 | It also supports asynchnous calls for all kinds of data transfer, | 156 | It also supports asynchronous calls for all kinds of data transfer, |
| 157 | using request structures called "URBs" (USB Request Blocks). | 157 | using request structures called "URBs" (USB Request Blocks). |
| 158 | </para></listitem> | 158 | </para></listitem> |
| 159 | 159 | ||
diff --git a/Documentation/DocBook/writing-an-alsa-driver.tmpl b/Documentation/DocBook/writing-an-alsa-driver.tmpl index d0056a4e9c53..6f639d9530b5 100644 --- a/Documentation/DocBook/writing-an-alsa-driver.tmpl +++ b/Documentation/DocBook/writing-an-alsa-driver.tmpl | |||
| @@ -5696,7 +5696,7 @@ struct _snd_pcm_runtime { | |||
| 5696 | suspending the PCM operations via | 5696 | suspending the PCM operations via |
| 5697 | <function>snd_pcm_suspend_all()</function> or | 5697 | <function>snd_pcm_suspend_all()</function> or |
| 5698 | <function>snd_pcm_suspend()</function>. It means that the PCM | 5698 | <function>snd_pcm_suspend()</function>. It means that the PCM |
| 5699 | streams are already stoppped when the register snapshot is | 5699 | streams are already stopped when the register snapshot is |
| 5700 | taken. But, remember that you don't have to restart the PCM | 5700 | taken. But, remember that you don't have to restart the PCM |
| 5701 | stream in the resume callback. It'll be restarted via | 5701 | stream in the resume callback. It'll be restarted via |
| 5702 | trigger call with <constant>SNDRV_PCM_TRIGGER_RESUME</constant> | 5702 | trigger call with <constant>SNDRV_PCM_TRIGGER_RESUME</constant> |
diff --git a/Documentation/cpu-freq/intel-pstate.txt b/Documentation/cpu-freq/intel-pstate.txt index e742d21dbd96..a69ffe1d54d5 100644 --- a/Documentation/cpu-freq/intel-pstate.txt +++ b/Documentation/cpu-freq/intel-pstate.txt | |||
| @@ -15,10 +15,13 @@ New sysfs files for controlling P state selection have been added to | |||
| 15 | /sys/devices/system/cpu/intel_pstate/ | 15 | /sys/devices/system/cpu/intel_pstate/ |
| 16 | 16 | ||
| 17 | max_perf_pct: limits the maximum P state that will be requested by | 17 | max_perf_pct: limits the maximum P state that will be requested by |
| 18 | the driver stated as a percentage of the available performance. | 18 | the driver stated as a percentage of the available performance. The |
| 19 | available (P states) performance may be reduced by the no_turbo | ||
| 20 | setting described below. | ||
| 19 | 21 | ||
| 20 | min_perf_pct: limits the minimum P state that will be requested by | 22 | min_perf_pct: limits the minimum P state that will be requested by |
| 21 | the driver stated as a percentage of the available performance. | 23 | the driver stated as a percentage of the max (non-turbo) |
| 24 | performance level. | ||
| 22 | 25 | ||
| 23 | no_turbo: limits the driver to selecting P states below the turbo | 26 | no_turbo: limits the driver to selecting P states below the turbo |
| 24 | frequency range. | 27 | frequency range. |
diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt index 5216b419016a..8b4f7b7fe88b 100644 --- a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt +++ b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt | |||
| @@ -9,6 +9,18 @@ Required Properties: | |||
| 9 | - reg: physical base address of the controller and length of memory mapped | 9 | - reg: physical base address of the controller and length of memory mapped |
| 10 | region. | 10 | region. |
| 11 | 11 | ||
| 12 | Optional Properties: | ||
| 13 | - clocks: List of clock handles. The parent clocks of the input clocks to the | ||
| 14 | devices in this power domain are set to oscclk before power gating | ||
| 15 | and restored back after powering on a domain. This is required for | ||
| 16 | all domains which are powered on and off and not required for unused | ||
| 17 | domains. | ||
| 18 | - clock-names: The following clocks can be specified: | ||
| 19 | - oscclk: Oscillator clock. | ||
| 20 | - pclkN, clkN: Pairs of parent of input clock and input clock to the | ||
| 21 | devices in this power domain. Maximum of 4 pairs (N = 0 to 3) | ||
| 22 | are supported currently. | ||
| 23 | |||
| 12 | Node of a device using power domains must have a samsung,power-domain property | 24 | Node of a device using power domains must have a samsung,power-domain property |
| 13 | defined with a phandle to respective power domain. | 25 | defined with a phandle to respective power domain. |
| 14 | 26 | ||
| @@ -19,6 +31,14 @@ Example: | |||
| 19 | reg = <0x10023C00 0x10>; | 31 | reg = <0x10023C00 0x10>; |
| 20 | }; | 32 | }; |
| 21 | 33 | ||
| 34 | mfc_pd: power-domain@10044060 { | ||
| 35 | compatible = "samsung,exynos4210-pd"; | ||
| 36 | reg = <0x10044060 0x20>; | ||
| 37 | clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_SW_ACLK333>, | ||
| 38 | <&clock CLK_MOUT_USER_ACLK333>; | ||
| 39 | clock-names = "oscclk", "pclk0", "clk0"; | ||
| 40 | }; | ||
| 41 | |||
| 22 | Example of the node using power domain: | 42 | Example of the node using power domain: |
| 23 | 43 | ||
| 24 | node { | 44 | node { |
diff --git a/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt index 64fd7dec1bbc..b3556609a06f 100644 --- a/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt +++ b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt | |||
| @@ -4,6 +4,13 @@ Required properties: | |||
| 4 | 4 | ||
| 5 | - compatible: Must contain one of the following: | 5 | - compatible: Must contain one of the following: |
| 6 | 6 | ||
| 7 | - "renesas,scifa-sh73a0" for SH73A0 (SH-Mobile AG5) SCIFA compatible UART. | ||
| 8 | - "renesas,scifb-sh73a0" for SH73A0 (SH-Mobile AG5) SCIFB compatible UART. | ||
| 9 | - "renesas,scifa-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFA compatible UART. | ||
| 10 | - "renesas,scifb-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFB compatible UART. | ||
| 11 | - "renesas,scifa-r8a7740" for R8A7740 (R-Mobile A1) SCIFA compatible UART. | ||
| 12 | - "renesas,scifb-r8a7740" for R8A7740 (R-Mobile A1) SCIFB compatible UART. | ||
| 13 | - "renesas,scif-r8a7778" for R8A7778 (R-Car M1) SCIF compatible UART. | ||
| 7 | - "renesas,scif-r8a7779" for R8A7779 (R-Car H1) SCIF compatible UART. | 14 | - "renesas,scif-r8a7779" for R8A7779 (R-Car H1) SCIF compatible UART. |
| 8 | - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART. | 15 | - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART. |
| 9 | - "renesas,scifa-r8a7790" for R8A7790 (R-Car H2) SCIFA compatible UART. | 16 | - "renesas,scifa-r8a7790" for R8A7790 (R-Car H2) SCIFA compatible UART. |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index c1b9aa8c5a52..e332e718cad6 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
| @@ -3526,7 +3526,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
| 3526 | the allocated input device; If set to 0, video driver | 3526 | the allocated input device; If set to 0, video driver |
| 3527 | will only send out the event without touching backlight | 3527 | will only send out the event without touching backlight |
| 3528 | brightness level. | 3528 | brightness level. |
| 3529 | default: 0 | 3529 | default: 1 |
| 3530 | 3530 | ||
| 3531 | virtio_mmio.device= | 3531 | virtio_mmio.device= |
| 3532 | [VMMIO] Memory mapped virtio (platform) device. | 3532 | [VMMIO] Memory mapped virtio (platform) device. |
diff --git a/Documentation/laptops/00-INDEX b/Documentation/laptops/00-INDEX index d13b9a9a9e00..d399ae1fc724 100644 --- a/Documentation/laptops/00-INDEX +++ b/Documentation/laptops/00-INDEX | |||
| @@ -8,8 +8,8 @@ disk-shock-protection.txt | |||
| 8 | - information on hard disk shock protection. | 8 | - information on hard disk shock protection. |
| 9 | dslm.c | 9 | dslm.c |
| 10 | - Simple Disk Sleep Monitor program | 10 | - Simple Disk Sleep Monitor program |
| 11 | hpfall.c | 11 | freefall.c |
| 12 | - (HP) laptop accelerometer program for disk protection. | 12 | - (HP/DELL) laptop accelerometer program for disk protection. |
| 13 | laptop-mode.txt | 13 | laptop-mode.txt |
| 14 | - how to conserve battery power using laptop-mode. | 14 | - how to conserve battery power using laptop-mode. |
| 15 | sony-laptop.txt | 15 | sony-laptop.txt |
diff --git a/Documentation/laptops/hpfall.c b/Documentation/laptops/freefall.c index b85dbbac0499..aab2ff09e868 100644 --- a/Documentation/laptops/hpfall.c +++ b/Documentation/laptops/freefall.c | |||
| @@ -1,7 +1,9 @@ | |||
| 1 | /* Disk protection for HP machines. | 1 | /* Disk protection for HP/DELL machines. |
| 2 | * | 2 | * |
| 3 | * Copyright 2008 Eric Piel | 3 | * Copyright 2008 Eric Piel |
| 4 | * Copyright 2009 Pavel Machek <pavel@ucw.cz> | 4 | * Copyright 2009 Pavel Machek <pavel@ucw.cz> |
| 5 | * Copyright 2012 Sonal Santan | ||
| 6 | * Copyright 2014 Pali Rohár <pali.rohar@gmail.com> | ||
| 5 | * | 7 | * |
| 6 | * GPLv2. | 8 | * GPLv2. |
| 7 | */ | 9 | */ |
| @@ -18,24 +20,31 @@ | |||
| 18 | #include <signal.h> | 20 | #include <signal.h> |
| 19 | #include <sys/mman.h> | 21 | #include <sys/mman.h> |
| 20 | #include <sched.h> | 22 | #include <sched.h> |
| 23 | #include <syslog.h> | ||
| 21 | 24 | ||
| 22 | char unload_heads_path[64]; | 25 | static int noled; |
| 26 | static char unload_heads_path[64]; | ||
| 27 | static char device_path[32]; | ||
| 28 | static const char app_name[] = "FREE FALL"; | ||
| 23 | 29 | ||
| 24 | int set_unload_heads_path(char *device) | 30 | static int set_unload_heads_path(char *device) |
| 25 | { | 31 | { |
| 26 | char devname[64]; | 32 | char devname[64]; |
| 27 | 33 | ||
| 28 | if (strlen(device) <= 5 || strncmp(device, "/dev/", 5) != 0) | 34 | if (strlen(device) <= 5 || strncmp(device, "/dev/", 5) != 0) |
| 29 | return -EINVAL; | 35 | return -EINVAL; |
| 30 | strncpy(devname, device + 5, sizeof(devname)); | 36 | strncpy(devname, device + 5, sizeof(devname) - 1); |
| 37 | strncpy(device_path, device, sizeof(device_path) - 1); | ||
| 31 | 38 | ||
| 32 | snprintf(unload_heads_path, sizeof(unload_heads_path) - 1, | 39 | snprintf(unload_heads_path, sizeof(unload_heads_path) - 1, |
| 33 | "/sys/block/%s/device/unload_heads", devname); | 40 | "/sys/block/%s/device/unload_heads", devname); |
| 34 | return 0; | 41 | return 0; |
| 35 | } | 42 | } |
| 36 | int valid_disk(void) | 43 | |
| 44 | static int valid_disk(void) | ||
| 37 | { | 45 | { |
| 38 | int fd = open(unload_heads_path, O_RDONLY); | 46 | int fd = open(unload_heads_path, O_RDONLY); |
| 47 | |||
| 39 | if (fd < 0) { | 48 | if (fd < 0) { |
| 40 | perror(unload_heads_path); | 49 | perror(unload_heads_path); |
| 41 | return 0; | 50 | return 0; |
| @@ -45,43 +54,54 @@ int valid_disk(void) | |||
| 45 | return 1; | 54 | return 1; |
| 46 | } | 55 | } |
| 47 | 56 | ||
| 48 | void write_int(char *path, int i) | 57 | static void write_int(char *path, int i) |
| 49 | { | 58 | { |
| 50 | char buf[1024]; | 59 | char buf[1024]; |
| 51 | int fd = open(path, O_RDWR); | 60 | int fd = open(path, O_RDWR); |
| 61 | |||
| 52 | if (fd < 0) { | 62 | if (fd < 0) { |
| 53 | perror("open"); | 63 | perror("open"); |
| 54 | exit(1); | 64 | exit(1); |
| 55 | } | 65 | } |
| 66 | |||
| 56 | sprintf(buf, "%d", i); | 67 | sprintf(buf, "%d", i); |
| 68 | |||
| 57 | if (write(fd, buf, strlen(buf)) != strlen(buf)) { | 69 | if (write(fd, buf, strlen(buf)) != strlen(buf)) { |
| 58 | perror("write"); | 70 | perror("write"); |
| 59 | exit(1); | 71 | exit(1); |
| 60 | } | 72 | } |
| 73 | |||
| 61 | close(fd); | 74 | close(fd); |
| 62 | } | 75 | } |
| 63 | 76 | ||
| 64 | void set_led(int on) | 77 | static void set_led(int on) |
| 65 | { | 78 | { |
| 79 | if (noled) | ||
| 80 | return; | ||
| 66 | write_int("/sys/class/leds/hp::hddprotect/brightness", on); | 81 | write_int("/sys/class/leds/hp::hddprotect/brightness", on); |
| 67 | } | 82 | } |
| 68 | 83 | ||
| 69 | void protect(int seconds) | 84 | static void protect(int seconds) |
| 70 | { | 85 | { |
| 86 | const char *str = (seconds == 0) ? "Unparked" : "Parked"; | ||
| 87 | |||
| 71 | write_int(unload_heads_path, seconds*1000); | 88 | write_int(unload_heads_path, seconds*1000); |
| 89 | syslog(LOG_INFO, "%s %s disk head\n", str, device_path); | ||
| 72 | } | 90 | } |
| 73 | 91 | ||
| 74 | int on_ac(void) | 92 | static int on_ac(void) |
| 75 | { | 93 | { |
| 76 | // /sys/class/power_supply/AC0/online | 94 | /* /sys/class/power_supply/AC0/online */ |
| 95 | return 1; | ||
| 77 | } | 96 | } |
| 78 | 97 | ||
| 79 | int lid_open(void) | 98 | static int lid_open(void) |
| 80 | { | 99 | { |
| 81 | // /proc/acpi/button/lid/LID/state | 100 | /* /proc/acpi/button/lid/LID/state */ |
| 101 | return 1; | ||
| 82 | } | 102 | } |
| 83 | 103 | ||
| 84 | void ignore_me(void) | 104 | static void ignore_me(int signum) |
| 85 | { | 105 | { |
| 86 | protect(0); | 106 | protect(0); |
| 87 | set_led(0); | 107 | set_led(0); |
| @@ -90,6 +110,7 @@ void ignore_me(void) | |||
| 90 | int main(int argc, char **argv) | 110 | int main(int argc, char **argv) |
| 91 | { | 111 | { |
| 92 | int fd, ret; | 112 | int fd, ret; |
| 113 | struct stat st; | ||
| 93 | struct sched_param param; | 114 | struct sched_param param; |
| 94 | 115 | ||
| 95 | if (argc == 1) | 116 | if (argc == 1) |
| @@ -111,7 +132,16 @@ int main(int argc, char **argv) | |||
| 111 | return EXIT_FAILURE; | 132 | return EXIT_FAILURE; |
| 112 | } | 133 | } |
| 113 | 134 | ||
| 114 | daemon(0, 0); | 135 | if (stat("/sys/class/leds/hp::hddprotect/brightness", &st)) |
| 136 | noled = 1; | ||
| 137 | |||
| 138 | if (daemon(0, 0) != 0) { | ||
| 139 | perror("daemon"); | ||
| 140 | return EXIT_FAILURE; | ||
| 141 | } | ||
| 142 | |||
| 143 | openlog(app_name, LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1); | ||
| 144 | |||
| 115 | param.sched_priority = sched_get_priority_max(SCHED_FIFO); | 145 | param.sched_priority = sched_get_priority_max(SCHED_FIFO); |
| 116 | sched_setscheduler(0, SCHED_FIFO, ¶m); | 146 | sched_setscheduler(0, SCHED_FIFO, ¶m); |
| 117 | mlockall(MCL_CURRENT|MCL_FUTURE); | 147 | mlockall(MCL_CURRENT|MCL_FUTURE); |
| @@ -141,6 +171,7 @@ int main(int argc, char **argv) | |||
| 141 | alarm(20); | 171 | alarm(20); |
| 142 | } | 172 | } |
| 143 | 173 | ||
| 174 | closelog(); | ||
| 144 | close(fd); | 175 | close(fd); |
| 145 | return EXIT_SUCCESS; | 176 | return EXIT_SUCCESS; |
| 146 | } | 177 | } |
diff --git a/MAINTAINERS b/MAINTAINERS index 6813d0aa5ecf..e31c87474739 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -1314,6 +1314,20 @@ W: http://oss.renesas.com | |||
| 1314 | Q: http://patchwork.kernel.org/project/linux-sh/list/ | 1314 | Q: http://patchwork.kernel.org/project/linux-sh/list/ |
| 1315 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git next | 1315 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git next |
| 1316 | S: Supported | 1316 | S: Supported |
| 1317 | F: arch/arm/boot/dts/emev2* | ||
| 1318 | F: arch/arm/boot/dts/r7s* | ||
| 1319 | F: arch/arm/boot/dts/r8a* | ||
| 1320 | F: arch/arm/boot/dts/sh* | ||
| 1321 | F: arch/arm/configs/ape6evm_defconfig | ||
| 1322 | F: arch/arm/configs/armadillo800eva_defconfig | ||
| 1323 | F: arch/arm/configs/bockw_defconfig | ||
| 1324 | F: arch/arm/configs/genmai_defconfig | ||
| 1325 | F: arch/arm/configs/koelsch_defconfig | ||
| 1326 | F: arch/arm/configs/kzm9g_defconfig | ||
| 1327 | F: arch/arm/configs/lager_defconfig | ||
| 1328 | F: arch/arm/configs/mackerel_defconfig | ||
| 1329 | F: arch/arm/configs/marzen_defconfig | ||
| 1330 | F: arch/arm/configs/shmobile_defconfig | ||
| 1317 | F: arch/arm/mach-shmobile/ | 1331 | F: arch/arm/mach-shmobile/ |
| 1318 | F: drivers/sh/ | 1332 | F: drivers/sh/ |
| 1319 | 1333 | ||
| @@ -6787,7 +6801,7 @@ F: arch/x86/kernel/quirks.c | |||
| 6787 | 6801 | ||
| 6788 | PCI DRIVER FOR IMX6 | 6802 | PCI DRIVER FOR IMX6 |
| 6789 | M: Richard Zhu <r65037@freescale.com> | 6803 | M: Richard Zhu <r65037@freescale.com> |
| 6790 | M: Shawn Guo <shawn.guo@linaro.org> | 6804 | M: Shawn Guo <shawn.guo@freescale.com> |
| 6791 | L: linux-pci@vger.kernel.org | 6805 | L: linux-pci@vger.kernel.org |
| 6792 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 6806 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 6793 | S: Maintained | 6807 | S: Maintained |
| @@ -8984,7 +8998,7 @@ F: drivers/media/radio/radio-raremono.c | |||
| 8984 | 8998 | ||
| 8985 | THERMAL | 8999 | THERMAL |
| 8986 | M: Zhang Rui <rui.zhang@intel.com> | 9000 | M: Zhang Rui <rui.zhang@intel.com> |
| 8987 | M: Eduardo Valentin <eduardo.valentin@ti.com> | 9001 | M: Eduardo Valentin <edubezval@gmail.com> |
| 8988 | L: linux-pm@vger.kernel.org | 9002 | L: linux-pm@vger.kernel.org |
| 8989 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git | 9003 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git |
| 8990 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal.git | 9004 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal.git |
| @@ -9011,7 +9025,7 @@ S: Maintained | |||
| 9011 | F: drivers/platform/x86/thinkpad_acpi.c | 9025 | F: drivers/platform/x86/thinkpad_acpi.c |
| 9012 | 9026 | ||
| 9013 | TI BANDGAP AND THERMAL DRIVER | 9027 | TI BANDGAP AND THERMAL DRIVER |
| 9014 | M: Eduardo Valentin <eduardo.valentin@ti.com> | 9028 | M: Eduardo Valentin <edubezval@gmail.com> |
| 9015 | L: linux-pm@vger.kernel.org | 9029 | L: linux-pm@vger.kernel.org |
| 9016 | S: Supported | 9030 | S: Supported |
| 9017 | F: drivers/thermal/ti-soc-thermal/ | 9031 | F: drivers/thermal/ti-soc-thermal/ |
| @@ -1,7 +1,7 @@ | |||
| 1 | VERSION = 3 | 1 | VERSION = 3 |
| 2 | PATCHLEVEL = 16 | 2 | PATCHLEVEL = 16 |
| 3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
| 4 | EXTRAVERSION = -rc4 | 4 | EXTRAVERSION = -rc5 |
| 5 | NAME = Shuffling Zombie Juror | 5 | NAME = Shuffling Zombie Juror |
| 6 | 6 | ||
| 7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
| @@ -41,6 +41,29 @@ unexport GREP_OPTIONS | |||
| 41 | # descending is started. They are now explicitly listed as the | 41 | # descending is started. They are now explicitly listed as the |
| 42 | # prepare rule. | 42 | # prepare rule. |
| 43 | 43 | ||
| 44 | # Beautify output | ||
| 45 | # --------------------------------------------------------------------------- | ||
| 46 | # | ||
| 47 | # Normally, we echo the whole command before executing it. By making | ||
| 48 | # that echo $($(quiet)$(cmd)), we now have the possibility to set | ||
| 49 | # $(quiet) to choose other forms of output instead, e.g. | ||
| 50 | # | ||
| 51 | # quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@ | ||
| 52 | # cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< | ||
| 53 | # | ||
| 54 | # If $(quiet) is empty, the whole command will be printed. | ||
| 55 | # If it is set to "quiet_", only the short version will be printed. | ||
| 56 | # If it is set to "silent_", nothing will be printed at all, since | ||
| 57 | # the variable $(silent_cmd_cc_o_c) doesn't exist. | ||
| 58 | # | ||
| 59 | # A simple variant is to prefix commands with $(Q) - that's useful | ||
| 60 | # for commands that shall be hidden in non-verbose mode. | ||
| 61 | # | ||
| 62 | # $(Q)ln $@ :< | ||
| 63 | # | ||
| 64 | # If KBUILD_VERBOSE equals 0 then the above command will be hidden. | ||
| 65 | # If KBUILD_VERBOSE equals 1 then the above command is displayed. | ||
| 66 | # | ||
| 44 | # To put more focus on warnings, be less verbose as default | 67 | # To put more focus on warnings, be less verbose as default |
| 45 | # Use 'make V=1' to see the full commands | 68 | # Use 'make V=1' to see the full commands |
| 46 | 69 | ||
| @@ -51,6 +74,29 @@ ifndef KBUILD_VERBOSE | |||
| 51 | KBUILD_VERBOSE = 0 | 74 | KBUILD_VERBOSE = 0 |
| 52 | endif | 75 | endif |
| 53 | 76 | ||
| 77 | ifeq ($(KBUILD_VERBOSE),1) | ||
| 78 | quiet = | ||
| 79 | Q = | ||
| 80 | else | ||
| 81 | quiet=quiet_ | ||
| 82 | Q = @ | ||
| 83 | endif | ||
| 84 | |||
| 85 | # If the user is running make -s (silent mode), suppress echoing of | ||
| 86 | # commands | ||
| 87 | |||
| 88 | ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4 | ||
| 89 | ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),) | ||
| 90 | quiet=silent_ | ||
| 91 | endif | ||
| 92 | else # make-3.8x | ||
| 93 | ifneq ($(filter s% -s%,$(MAKEFLAGS)),) | ||
| 94 | quiet=silent_ | ||
| 95 | endif | ||
| 96 | endif | ||
| 97 | |||
| 98 | export quiet Q KBUILD_VERBOSE | ||
| 99 | |||
| 54 | # Call a source code checker (by default, "sparse") as part of the | 100 | # Call a source code checker (by default, "sparse") as part of the |
| 55 | # C compilation. | 101 | # C compilation. |
| 56 | # | 102 | # |
| @@ -128,8 +174,11 @@ $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make | |||
| 128 | 174 | ||
| 129 | # Fake the "Entering directory" message once, so that IDEs/editors are | 175 | # Fake the "Entering directory" message once, so that IDEs/editors are |
| 130 | # able to understand relative filenames. | 176 | # able to understand relative filenames. |
| 177 | echodir := @echo | ||
| 178 | quiet_echodir := @echo | ||
| 179 | silent_echodir := @: | ||
| 131 | sub-make: FORCE | 180 | sub-make: FORCE |
| 132 | @echo "make[1]: Entering directory \`$(KBUILD_OUTPUT)'" | 181 | $($(quiet)echodir) "make[1]: Entering directory \`$(KBUILD_OUTPUT)'" |
| 133 | $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ | 182 | $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ |
| 134 | KBUILD_SRC=$(CURDIR) \ | 183 | KBUILD_SRC=$(CURDIR) \ |
| 135 | KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \ | 184 | KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \ |
| @@ -292,52 +341,6 @@ endif | |||
| 292 | export KBUILD_MODULES KBUILD_BUILTIN | 341 | export KBUILD_MODULES KBUILD_BUILTIN |
| 293 | export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD | 342 | export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD |
| 294 | 343 | ||
| 295 | # Beautify output | ||
| 296 | # --------------------------------------------------------------------------- | ||
| 297 | # | ||
| 298 | # Normally, we echo the whole command before executing it. By making | ||
| 299 | # that echo $($(quiet)$(cmd)), we now have the possibility to set | ||
| 300 | # $(quiet) to choose other forms of output instead, e.g. | ||
| 301 | # | ||
| 302 | # quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@ | ||
| 303 | # cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< | ||
| 304 | # | ||
| 305 | # If $(quiet) is empty, the whole command will be printed. | ||
| 306 | # If it is set to "quiet_", only the short version will be printed. | ||
| 307 | # If it is set to "silent_", nothing will be printed at all, since | ||
| 308 | # the variable $(silent_cmd_cc_o_c) doesn't exist. | ||
| 309 | # | ||
| 310 | # A simple variant is to prefix commands with $(Q) - that's useful | ||
| 311 | # for commands that shall be hidden in non-verbose mode. | ||
| 312 | # | ||
| 313 | # $(Q)ln $@ :< | ||
| 314 | # | ||
| 315 | # If KBUILD_VERBOSE equals 0 then the above command will be hidden. | ||
| 316 | # If KBUILD_VERBOSE equals 1 then the above command is displayed. | ||
| 317 | |||
| 318 | ifeq ($(KBUILD_VERBOSE),1) | ||
| 319 | quiet = | ||
| 320 | Q = | ||
| 321 | else | ||
| 322 | quiet=quiet_ | ||
| 323 | Q = @ | ||
| 324 | endif | ||
| 325 | |||
| 326 | # If the user is running make -s (silent mode), suppress echoing of | ||
| 327 | # commands | ||
| 328 | |||
| 329 | ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4 | ||
| 330 | ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),) | ||
| 331 | quiet=silent_ | ||
| 332 | endif | ||
| 333 | else # make-3.8x | ||
| 334 | ifneq ($(filter s% -s%,$(MAKEFLAGS)),) | ||
| 335 | quiet=silent_ | ||
| 336 | endif | ||
| 337 | endif | ||
| 338 | |||
| 339 | export quiet Q KBUILD_VERBOSE | ||
| 340 | |||
| 341 | ifneq ($(CC),) | 344 | ifneq ($(CC),) |
| 342 | ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1) | 345 | ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1) |
| 343 | COMPILER := clang | 346 | COMPILER := clang |
| @@ -1173,7 +1176,7 @@ distclean: mrproper | |||
| 1173 | # Packaging of the kernel to various formats | 1176 | # Packaging of the kernel to various formats |
| 1174 | # --------------------------------------------------------------------------- | 1177 | # --------------------------------------------------------------------------- |
| 1175 | # rpm target kept for backward compatibility | 1178 | # rpm target kept for backward compatibility |
| 1176 | package-dir := $(srctree)/scripts/package | 1179 | package-dir := scripts/package |
| 1177 | 1180 | ||
| 1178 | %src-pkg: FORCE | 1181 | %src-pkg: FORCE |
| 1179 | $(Q)$(MAKE) $(build)=$(package-dir) $@ | 1182 | $(Q)$(MAKE) $(build)=$(package-dir) $@ |
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts index ecb267767cf5..e2156a583de7 100644 --- a/arch/arm/boot/dts/am335x-evm.dts +++ b/arch/arm/boot/dts/am335x-evm.dts | |||
| @@ -529,8 +529,8 @@ | |||
| 529 | serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ | 529 | serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ |
| 530 | 0 0 1 2 | 530 | 0 0 1 2 |
| 531 | >; | 531 | >; |
| 532 | tx-num-evt = <1>; | 532 | tx-num-evt = <32>; |
| 533 | rx-num-evt = <1>; | 533 | rx-num-evt = <32>; |
| 534 | }; | 534 | }; |
| 535 | 535 | ||
| 536 | &tps { | 536 | &tps { |
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts index ab9a34ce524c..80a3b215e7d6 100644 --- a/arch/arm/boot/dts/am335x-evmsk.dts +++ b/arch/arm/boot/dts/am335x-evmsk.dts | |||
| @@ -560,8 +560,8 @@ | |||
| 560 | serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ | 560 | serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ |
| 561 | 0 0 1 2 | 561 | 0 0 1 2 |
| 562 | >; | 562 | >; |
| 563 | tx-num-evt = <1>; | 563 | tx-num-evt = <32>; |
| 564 | rx-num-evt = <1>; | 564 | rx-num-evt = <32>; |
| 565 | }; | 565 | }; |
| 566 | 566 | ||
| 567 | &tscadc { | 567 | &tscadc { |
diff --git a/arch/arm/boot/dts/am335x-igep0033.dtsi b/arch/arm/boot/dts/am335x-igep0033.dtsi index 8a0a72dc7dd7..a1a0cc5eb35c 100644 --- a/arch/arm/boot/dts/am335x-igep0033.dtsi +++ b/arch/arm/boot/dts/am335x-igep0033.dtsi | |||
| @@ -105,10 +105,16 @@ | |||
| 105 | 105 | ||
| 106 | &cpsw_emac0 { | 106 | &cpsw_emac0 { |
| 107 | phy_id = <&davinci_mdio>, <0>; | 107 | phy_id = <&davinci_mdio>, <0>; |
| 108 | phy-mode = "rmii"; | ||
| 108 | }; | 109 | }; |
| 109 | 110 | ||
| 110 | &cpsw_emac1 { | 111 | &cpsw_emac1 { |
| 111 | phy_id = <&davinci_mdio>, <1>; | 112 | phy_id = <&davinci_mdio>, <1>; |
| 113 | phy-mode = "rmii"; | ||
| 114 | }; | ||
| 115 | |||
| 116 | &phy_sel { | ||
| 117 | rmii-clock-ext; | ||
| 112 | }; | 118 | }; |
| 113 | 119 | ||
| 114 | &elm { | 120 | &elm { |
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi index d6133f497207..2ebc42140ea6 100644 --- a/arch/arm/boot/dts/at91sam9x5.dtsi +++ b/arch/arm/boot/dts/at91sam9x5.dtsi | |||
| @@ -1045,6 +1045,8 @@ | |||
| 1045 | reg = <0x00500000 0x80000 | 1045 | reg = <0x00500000 0x80000 |
| 1046 | 0xf803c000 0x400>; | 1046 | 0xf803c000 0x400>; |
| 1047 | interrupts = <23 IRQ_TYPE_LEVEL_HIGH 0>; | 1047 | interrupts = <23 IRQ_TYPE_LEVEL_HIGH 0>; |
| 1048 | clocks = <&usb>, <&udphs_clk>; | ||
| 1049 | clock-names = "hclk", "pclk"; | ||
| 1048 | status = "disabled"; | 1050 | status = "disabled"; |
| 1049 | 1051 | ||
| 1050 | ep0 { | 1052 | ep0 { |
diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts index 4adc28039c30..83089540e324 100644 --- a/arch/arm/boot/dts/dra7-evm.dts +++ b/arch/arm/boot/dts/dra7-evm.dts | |||
| @@ -240,6 +240,7 @@ | |||
| 240 | regulator-name = "ldo3"; | 240 | regulator-name = "ldo3"; |
| 241 | regulator-min-microvolt = <1800000>; | 241 | regulator-min-microvolt = <1800000>; |
| 242 | regulator-max-microvolt = <1800000>; | 242 | regulator-max-microvolt = <1800000>; |
| 243 | regulator-always-on; | ||
| 243 | regulator-boot-on; | 244 | regulator-boot-on; |
| 244 | }; | 245 | }; |
| 245 | 246 | ||
diff --git a/arch/arm/boot/dts/dra7xx-clocks.dtsi b/arch/arm/boot/dts/dra7xx-clocks.dtsi index c90c76de84d6..dc7a292fe939 100644 --- a/arch/arm/boot/dts/dra7xx-clocks.dtsi +++ b/arch/arm/boot/dts/dra7xx-clocks.dtsi | |||
| @@ -673,10 +673,12 @@ | |||
| 673 | 673 | ||
| 674 | l3_iclk_div: l3_iclk_div { | 674 | l3_iclk_div: l3_iclk_div { |
| 675 | #clock-cells = <0>; | 675 | #clock-cells = <0>; |
| 676 | compatible = "fixed-factor-clock"; | 676 | compatible = "ti,divider-clock"; |
| 677 | ti,max-div = <2>; | ||
| 678 | ti,bit-shift = <4>; | ||
| 679 | reg = <0x0100>; | ||
| 677 | clocks = <&dpll_core_h12x2_ck>; | 680 | clocks = <&dpll_core_h12x2_ck>; |
| 678 | clock-mult = <1>; | 681 | ti,index-power-of-two; |
| 679 | clock-div = <1>; | ||
| 680 | }; | 682 | }; |
| 681 | 683 | ||
| 682 | l4_root_clk_div: l4_root_clk_div { | 684 | l4_root_clk_div: l4_root_clk_div { |
| @@ -684,7 +686,7 @@ | |||
| 684 | compatible = "fixed-factor-clock"; | 686 | compatible = "fixed-factor-clock"; |
| 685 | clocks = <&l3_iclk_div>; | 687 | clocks = <&l3_iclk_div>; |
| 686 | clock-mult = <1>; | 688 | clock-mult = <1>; |
| 687 | clock-div = <1>; | 689 | clock-div = <2>; |
| 688 | }; | 690 | }; |
| 689 | 691 | ||
| 690 | video1_clk2_div: video1_clk2_div { | 692 | video1_clk2_div: video1_clk2_div { |
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi index fbaf426d2daa..17b22e9cc2aa 100644 --- a/arch/arm/boot/dts/exynos4.dtsi +++ b/arch/arm/boot/dts/exynos4.dtsi | |||
| @@ -554,7 +554,7 @@ | |||
| 554 | interrupts = <0 37 0>, <0 38 0>, <0 39 0>, <0 40 0>, <0 41 0>; | 554 | interrupts = <0 37 0>, <0 38 0>, <0 39 0>, <0 40 0>, <0 41 0>; |
| 555 | clocks = <&clock CLK_PWM>; | 555 | clocks = <&clock CLK_PWM>; |
| 556 | clock-names = "timers"; | 556 | clock-names = "timers"; |
| 557 | #pwm-cells = <2>; | 557 | #pwm-cells = <3>; |
| 558 | status = "disabled"; | 558 | status = "disabled"; |
| 559 | }; | 559 | }; |
| 560 | 560 | ||
diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi index e38532271ef9..15957227ffda 100644 --- a/arch/arm/boot/dts/exynos5420.dtsi +++ b/arch/arm/boot/dts/exynos5420.dtsi | |||
| @@ -167,7 +167,7 @@ | |||
| 167 | compatible = "samsung,exynos5420-audss-clock"; | 167 | compatible = "samsung,exynos5420-audss-clock"; |
| 168 | reg = <0x03810000 0x0C>; | 168 | reg = <0x03810000 0x0C>; |
| 169 | #clock-cells = <1>; | 169 | #clock-cells = <1>; |
| 170 | clocks = <&clock CLK_FIN_PLL>, <&clock CLK_FOUT_EPLL>, | 170 | clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MAU_EPLL>, |
| 171 | <&clock CLK_SCLK_MAUDIO0>, <&clock CLK_SCLK_MAUPCM0>; | 171 | <&clock CLK_SCLK_MAUDIO0>, <&clock CLK_SCLK_MAUPCM0>; |
| 172 | clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in"; | 172 | clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in"; |
| 173 | }; | 173 | }; |
| @@ -260,6 +260,9 @@ | |||
| 260 | mfc_pd: power-domain@10044060 { | 260 | mfc_pd: power-domain@10044060 { |
| 261 | compatible = "samsung,exynos4210-pd"; | 261 | compatible = "samsung,exynos4210-pd"; |
| 262 | reg = <0x10044060 0x20>; | 262 | reg = <0x10044060 0x20>; |
| 263 | clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_SW_ACLK333>, | ||
| 264 | <&clock CLK_MOUT_USER_ACLK333>; | ||
| 265 | clock-names = "oscclk", "pclk0", "clk0"; | ||
| 263 | }; | 266 | }; |
| 264 | 267 | ||
| 265 | disp_pd: power-domain@100440C0 { | 268 | disp_pd: power-domain@100440C0 { |
diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c index 9db4b659d03e..cb1424240ff6 100644 --- a/arch/arm/kernel/kprobes-test-arm.c +++ b/arch/arm/kernel/kprobes-test-arm.c | |||
| @@ -74,8 +74,6 @@ void kprobe_arm_test_cases(void) | |||
| 74 | TEST_RRR( op "lt" s " r11, r",11,VAL1,", r",14,N(val),", asr r",7, 6,"")\ | 74 | TEST_RRR( op "lt" s " r11, r",11,VAL1,", r",14,N(val),", asr r",7, 6,"")\ |
| 75 | TEST_RR( op "gt" s " r12, r13" ", r",14,val, ", ror r",14,7,"")\ | 75 | TEST_RR( op "gt" s " r12, r13" ", r",14,val, ", ror r",14,7,"")\ |
| 76 | TEST_RR( op "le" s " r14, r",0, val, ", r13" ", lsl r",14,8,"")\ | 76 | TEST_RR( op "le" s " r14, r",0, val, ", r13" ", lsl r",14,8,"")\ |
| 77 | TEST_RR( op s " r12, pc" ", r",14,val, ", ror r",14,7,"")\ | ||
| 78 | TEST_RR( op s " r14, r",0, val, ", pc" ", lsl r",14,8,"")\ | ||
| 79 | TEST_R( op "eq" s " r0, r",11,VAL1,", #0xf5") \ | 77 | TEST_R( op "eq" s " r0, r",11,VAL1,", #0xf5") \ |
| 80 | TEST_R( op "ne" s " r11, r",0, VAL1,", #0xf5000000") \ | 78 | TEST_R( op "ne" s " r11, r",0, VAL1,", #0xf5000000") \ |
| 81 | TEST_R( op s " r7, r",8, VAL2,", #0x000af000") \ | 79 | TEST_R( op s " r7, r",8, VAL2,", #0x000af000") \ |
| @@ -103,8 +101,6 @@ void kprobe_arm_test_cases(void) | |||
| 103 | TEST_RRR( op "ge r",11,VAL1,", r",14,N(val),", asr r",7, 6,"") \ | 101 | TEST_RRR( op "ge r",11,VAL1,", r",14,N(val),", asr r",7, 6,"") \ |
| 104 | TEST_RR( op "le r13" ", r",14,val, ", ror r",14,7,"") \ | 102 | TEST_RR( op "le r13" ", r",14,val, ", ror r",14,7,"") \ |
| 105 | TEST_RR( op "gt r",0, val, ", r13" ", lsl r",14,8,"") \ | 103 | TEST_RR( op "gt r",0, val, ", r13" ", lsl r",14,8,"") \ |
| 106 | TEST_RR( op " pc" ", r",14,val, ", ror r",14,7,"") \ | ||
| 107 | TEST_RR( op " r",0, val, ", pc" ", lsl r",14,8,"") \ | ||
| 108 | TEST_R( op "eq r",11,VAL1,", #0xf5") \ | 104 | TEST_R( op "eq r",11,VAL1,", #0xf5") \ |
| 109 | TEST_R( op "ne r",0, VAL1,", #0xf5000000") \ | 105 | TEST_R( op "ne r",0, VAL1,", #0xf5000000") \ |
| 110 | TEST_R( op " r",8, VAL2,", #0x000af000") | 106 | TEST_R( op " r",8, VAL2,", #0x000af000") |
| @@ -125,7 +121,6 @@ void kprobe_arm_test_cases(void) | |||
| 125 | TEST_RR( op "ge" s " r11, r",11,N(val),", asr r",7, 6,"") \ | 121 | TEST_RR( op "ge" s " r11, r",11,N(val),", asr r",7, 6,"") \ |
| 126 | TEST_RR( op "lt" s " r12, r",11,val, ", ror r",14,7,"") \ | 122 | TEST_RR( op "lt" s " r12, r",11,val, ", ror r",14,7,"") \ |
| 127 | TEST_R( op "gt" s " r14, r13" ", lsl r",14,8,"") \ | 123 | TEST_R( op "gt" s " r14, r13" ", lsl r",14,8,"") \ |
| 128 | TEST_R( op "le" s " r14, pc" ", lsl r",14,8,"") \ | ||
| 129 | TEST( op "eq" s " r0, #0xf5") \ | 124 | TEST( op "eq" s " r0, #0xf5") \ |
| 130 | TEST( op "ne" s " r11, #0xf5000000") \ | 125 | TEST( op "ne" s " r11, #0xf5000000") \ |
| 131 | TEST( op s " r7, #0x000af000") \ | 126 | TEST( op s " r7, #0x000af000") \ |
| @@ -159,12 +154,19 @@ void kprobe_arm_test_cases(void) | |||
| 159 | TEST_SUPPORTED("cmp pc, #0x1000"); | 154 | TEST_SUPPORTED("cmp pc, #0x1000"); |
| 160 | TEST_SUPPORTED("cmp sp, #0x1000"); | 155 | TEST_SUPPORTED("cmp sp, #0x1000"); |
| 161 | 156 | ||
| 162 | /* Data-processing with PC as shift*/ | 157 | /* Data-processing with PC and a shift count in a register */ |
| 163 | TEST_UNSUPPORTED(__inst_arm(0xe15c0f1e) " @ cmp r12, r14, asl pc") | 158 | TEST_UNSUPPORTED(__inst_arm(0xe15c0f1e) " @ cmp r12, r14, asl pc") |
| 164 | TEST_UNSUPPORTED(__inst_arm(0xe1a0cf1e) " @ mov r12, r14, asl pc") | 159 | TEST_UNSUPPORTED(__inst_arm(0xe1a0cf1e) " @ mov r12, r14, asl pc") |
| 165 | TEST_UNSUPPORTED(__inst_arm(0xe08caf1e) " @ add r10, r12, r14, asl pc") | 160 | TEST_UNSUPPORTED(__inst_arm(0xe08caf1e) " @ add r10, r12, r14, asl pc") |
| 166 | 161 | TEST_UNSUPPORTED(__inst_arm(0xe151021f) " @ cmp r1, pc, lsl r2") | |
| 167 | /* Data-processing with PC as shift*/ | 162 | TEST_UNSUPPORTED(__inst_arm(0xe17f0211) " @ cmn pc, r1, lsl r2") |
| 163 | TEST_UNSUPPORTED(__inst_arm(0xe1a0121f) " @ mov r1, pc, lsl r2") | ||
| 164 | TEST_UNSUPPORTED(__inst_arm(0xe1a0f211) " @ mov pc, r1, lsl r2") | ||
| 165 | TEST_UNSUPPORTED(__inst_arm(0xe042131f) " @ sub r1, r2, pc, lsl r3") | ||
| 166 | TEST_UNSUPPORTED(__inst_arm(0xe1cf1312) " @ bic r1, pc, r2, lsl r3") | ||
| 167 | TEST_UNSUPPORTED(__inst_arm(0xe081f312) " @ add pc, r1, r2, lsl r3") | ||
| 168 | |||
| 169 | /* Data-processing with PC as a target and status registers updated */ | ||
| 168 | TEST_UNSUPPORTED("movs pc, r1") | 170 | TEST_UNSUPPORTED("movs pc, r1") |
| 169 | TEST_UNSUPPORTED("movs pc, r1, lsl r2") | 171 | TEST_UNSUPPORTED("movs pc, r1, lsl r2") |
| 170 | TEST_UNSUPPORTED("movs pc, #0x10000") | 172 | TEST_UNSUPPORTED("movs pc, #0x10000") |
| @@ -187,14 +189,14 @@ void kprobe_arm_test_cases(void) | |||
| 187 | TEST_BF_R ("add pc, pc, r",14,2f-1f-8,"") | 189 | TEST_BF_R ("add pc, pc, r",14,2f-1f-8,"") |
| 188 | TEST_BF_R ("add pc, r",14,2f-1f-8,", pc") | 190 | TEST_BF_R ("add pc, r",14,2f-1f-8,", pc") |
| 189 | TEST_BF_R ("mov pc, r",0,2f,"") | 191 | TEST_BF_R ("mov pc, r",0,2f,"") |
| 190 | TEST_BF_RR("mov pc, r",0,2f,", asl r",1,0,"") | 192 | TEST_BF_R ("add pc, pc, r",14,(2f-1f-8)*2,", asr #1") |
| 191 | TEST_BB( "sub pc, pc, #1b-2b+8") | 193 | TEST_BB( "sub pc, pc, #1b-2b+8") |
| 192 | #if __LINUX_ARM_ARCH__ == 6 && !defined(CONFIG_CPU_V7) | 194 | #if __LINUX_ARM_ARCH__ == 6 && !defined(CONFIG_CPU_V7) |
| 193 | TEST_BB( "sub pc, pc, #1b-2b+8-2") /* UNPREDICTABLE before and after ARMv6 */ | 195 | TEST_BB( "sub pc, pc, #1b-2b+8-2") /* UNPREDICTABLE before and after ARMv6 */ |
| 194 | #endif | 196 | #endif |
| 195 | TEST_BB_R( "sub pc, pc, r",14, 1f-2f+8,"") | 197 | TEST_BB_R( "sub pc, pc, r",14, 1f-2f+8,"") |
| 196 | TEST_BB_R( "rsb pc, r",14,1f-2f+8,", pc") | 198 | TEST_BB_R( "rsb pc, r",14,1f-2f+8,", pc") |
| 197 | TEST_RR( "add pc, pc, r",10,-2,", asl r",11,1,"") | 199 | TEST_R( "add pc, pc, r",10,-2,", asl #1") |
| 198 | #ifdef CONFIG_THUMB2_KERNEL | 200 | #ifdef CONFIG_THUMB2_KERNEL |
| 199 | TEST_ARM_TO_THUMB_INTERWORK_R("add pc, pc, r",0,3f-1f-8+1,"") | 201 | TEST_ARM_TO_THUMB_INTERWORK_R("add pc, pc, r",0,3f-1f-8+1,"") |
| 200 | TEST_ARM_TO_THUMB_INTERWORK_R("sub pc, r",0,3f+8+1,", #8") | 202 | TEST_ARM_TO_THUMB_INTERWORK_R("sub pc, r",0,3f+8+1,", #8") |
| @@ -216,6 +218,7 @@ void kprobe_arm_test_cases(void) | |||
| 216 | TEST_BB_R("bx r",7,2f,"") | 218 | TEST_BB_R("bx r",7,2f,"") |
| 217 | TEST_BF_R("bxeq r",14,2f,"") | 219 | TEST_BF_R("bxeq r",14,2f,"") |
| 218 | 220 | ||
| 221 | #if __LINUX_ARM_ARCH__ >= 5 | ||
| 219 | TEST_R("clz r0, r",0, 0x0,"") | 222 | TEST_R("clz r0, r",0, 0x0,"") |
| 220 | TEST_R("clzeq r7, r",14,0x1,"") | 223 | TEST_R("clzeq r7, r",14,0x1,"") |
| 221 | TEST_R("clz lr, r",7, 0xffffffff,"") | 224 | TEST_R("clz lr, r",7, 0xffffffff,"") |
| @@ -337,6 +340,7 @@ void kprobe_arm_test_cases(void) | |||
| 337 | TEST_UNSUPPORTED(__inst_arm(0xe16f02e1) " @ smultt pc, r1, r2") | 340 | TEST_UNSUPPORTED(__inst_arm(0xe16f02e1) " @ smultt pc, r1, r2") |
| 338 | TEST_UNSUPPORTED(__inst_arm(0xe16002ef) " @ smultt r0, pc, r2") | 341 | TEST_UNSUPPORTED(__inst_arm(0xe16002ef) " @ smultt r0, pc, r2") |
| 339 | TEST_UNSUPPORTED(__inst_arm(0xe1600fe1) " @ smultt r0, r1, pc") | 342 | TEST_UNSUPPORTED(__inst_arm(0xe1600fe1) " @ smultt r0, r1, pc") |
| 343 | #endif | ||
| 340 | 344 | ||
| 341 | TEST_GROUP("Multiply and multiply-accumulate") | 345 | TEST_GROUP("Multiply and multiply-accumulate") |
| 342 | 346 | ||
| @@ -559,6 +563,7 @@ void kprobe_arm_test_cases(void) | |||
| 559 | TEST_UNSUPPORTED("ldrsht r1, [r2], #48") | 563 | TEST_UNSUPPORTED("ldrsht r1, [r2], #48") |
| 560 | #endif | 564 | #endif |
| 561 | 565 | ||
| 566 | #if __LINUX_ARM_ARCH__ >= 5 | ||
| 562 | TEST_RPR( "strd r",0, VAL1,", [r",1, 48,", -r",2,24,"]") | 567 | TEST_RPR( "strd r",0, VAL1,", [r",1, 48,", -r",2,24,"]") |
| 563 | TEST_RPR( "strccd r",8, VAL2,", [r",13,0, ", r",12,48,"]") | 568 | TEST_RPR( "strccd r",8, VAL2,", [r",13,0, ", r",12,48,"]") |
| 564 | TEST_RPR( "strd r",4, VAL1,", [r",2, 24,", r",3, 48,"]!") | 569 | TEST_RPR( "strd r",4, VAL1,", [r",2, 24,", r",3, 48,"]!") |
| @@ -595,6 +600,7 @@ void kprobe_arm_test_cases(void) | |||
| 595 | TEST_UNSUPPORTED(__inst_arm(0xe1efc3d0) " @ ldrd r12, [pc, #48]!") | 600 | TEST_UNSUPPORTED(__inst_arm(0xe1efc3d0) " @ ldrd r12, [pc, #48]!") |
| 596 | TEST_UNSUPPORTED(__inst_arm(0xe0c9f3d0) " @ ldrd pc, [r9], #48") | 601 | TEST_UNSUPPORTED(__inst_arm(0xe0c9f3d0) " @ ldrd pc, [r9], #48") |
| 597 | TEST_UNSUPPORTED(__inst_arm(0xe0c9e3d0) " @ ldrd lr, [r9], #48") | 602 | TEST_UNSUPPORTED(__inst_arm(0xe0c9e3d0) " @ ldrd lr, [r9], #48") |
| 603 | #endif | ||
| 598 | 604 | ||
| 599 | TEST_GROUP("Miscellaneous") | 605 | TEST_GROUP("Miscellaneous") |
| 600 | 606 | ||
| @@ -1227,7 +1233,9 @@ void kprobe_arm_test_cases(void) | |||
| 1227 | TEST_COPROCESSOR( "mrc"two" 0, 0, r0, cr0, cr0, 0") | 1233 | TEST_COPROCESSOR( "mrc"two" 0, 0, r0, cr0, cr0, 0") |
| 1228 | 1234 | ||
| 1229 | COPROCESSOR_INSTRUCTIONS_ST_LD("",e) | 1235 | COPROCESSOR_INSTRUCTIONS_ST_LD("",e) |
| 1236 | #if __LINUX_ARM_ARCH__ >= 5 | ||
| 1230 | COPROCESSOR_INSTRUCTIONS_MC_MR("",e) | 1237 | COPROCESSOR_INSTRUCTIONS_MC_MR("",e) |
| 1238 | #endif | ||
| 1231 | TEST_UNSUPPORTED("svc 0") | 1239 | TEST_UNSUPPORTED("svc 0") |
| 1232 | TEST_UNSUPPORTED("svc 0xffffff") | 1240 | TEST_UNSUPPORTED("svc 0xffffff") |
| 1233 | 1241 | ||
| @@ -1287,7 +1295,9 @@ void kprobe_arm_test_cases(void) | |||
| 1287 | TEST( "blx __dummy_thumb_subroutine_odd") | 1295 | TEST( "blx __dummy_thumb_subroutine_odd") |
| 1288 | #endif /* __LINUX_ARM_ARCH__ >= 6 */ | 1296 | #endif /* __LINUX_ARM_ARCH__ >= 6 */ |
| 1289 | 1297 | ||
| 1298 | #if __LINUX_ARM_ARCH__ >= 5 | ||
| 1290 | COPROCESSOR_INSTRUCTIONS_ST_LD("2",f) | 1299 | COPROCESSOR_INSTRUCTIONS_ST_LD("2",f) |
| 1300 | #endif | ||
| 1291 | #if __LINUX_ARM_ARCH__ >= 6 | 1301 | #if __LINUX_ARM_ARCH__ >= 6 |
| 1292 | COPROCESSOR_INSTRUCTIONS_MC_MR("2",f) | 1302 | COPROCESSOR_INSTRUCTIONS_MC_MR("2",f) |
| 1293 | #endif | 1303 | #endif |
diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c index 379639998d5a..08d731294bcd 100644 --- a/arch/arm/kernel/kprobes-test.c +++ b/arch/arm/kernel/kprobes-test.c | |||
| @@ -225,6 +225,7 @@ static int pre_handler_called; | |||
| 225 | static int post_handler_called; | 225 | static int post_handler_called; |
| 226 | static int jprobe_func_called; | 226 | static int jprobe_func_called; |
| 227 | static int kretprobe_handler_called; | 227 | static int kretprobe_handler_called; |
| 228 | static int tests_failed; | ||
| 228 | 229 | ||
| 229 | #define FUNC_ARG1 0x12345678 | 230 | #define FUNC_ARG1 0x12345678 |
| 230 | #define FUNC_ARG2 0xabcdef | 231 | #define FUNC_ARG2 0xabcdef |
| @@ -461,6 +462,13 @@ static int run_api_tests(long (*func)(long, long)) | |||
| 461 | 462 | ||
| 462 | pr_info(" jprobe\n"); | 463 | pr_info(" jprobe\n"); |
| 463 | ret = test_jprobe(func); | 464 | ret = test_jprobe(func); |
| 465 | #if defined(CONFIG_THUMB2_KERNEL) && !defined(MODULE) | ||
| 466 | if (ret == -EINVAL) { | ||
| 467 | pr_err("FAIL: Known longtime bug with jprobe on Thumb kernels\n"); | ||
| 468 | tests_failed = ret; | ||
| 469 | ret = 0; | ||
| 470 | } | ||
| 471 | #endif | ||
| 464 | if (ret < 0) | 472 | if (ret < 0) |
| 465 | return ret; | 473 | return ret; |
| 466 | 474 | ||
| @@ -1672,6 +1680,8 @@ static int __init run_all_tests(void) | |||
| 1672 | 1680 | ||
| 1673 | out: | 1681 | out: |
| 1674 | if (ret == 0) | 1682 | if (ret == 0) |
| 1683 | ret = tests_failed; | ||
| 1684 | if (ret == 0) | ||
| 1675 | pr_info("Finished kprobe tests OK\n"); | 1685 | pr_info("Finished kprobe tests OK\n"); |
| 1676 | else | 1686 | else |
| 1677 | pr_err("kprobe tests failed\n"); | 1687 | pr_err("kprobe tests failed\n"); |
diff --git a/arch/arm/kernel/probes-arm.c b/arch/arm/kernel/probes-arm.c index 51a13a027989..8eaef81d8344 100644 --- a/arch/arm/kernel/probes-arm.c +++ b/arch/arm/kernel/probes-arm.c | |||
| @@ -341,12 +341,12 @@ static const union decode_item arm_cccc_000x_table[] = { | |||
| 341 | /* CMP (reg-shift reg) cccc 0001 0101 xxxx xxxx xxxx 0xx1 xxxx */ | 341 | /* CMP (reg-shift reg) cccc 0001 0101 xxxx xxxx xxxx 0xx1 xxxx */ |
| 342 | /* CMN (reg-shift reg) cccc 0001 0111 xxxx xxxx xxxx 0xx1 xxxx */ | 342 | /* CMN (reg-shift reg) cccc 0001 0111 xxxx xxxx xxxx 0xx1 xxxx */ |
| 343 | DECODE_EMULATEX (0x0f900090, 0x01100010, PROBES_DATA_PROCESSING_REG, | 343 | DECODE_EMULATEX (0x0f900090, 0x01100010, PROBES_DATA_PROCESSING_REG, |
| 344 | REGS(ANY, 0, NOPC, 0, ANY)), | 344 | REGS(NOPC, 0, NOPC, 0, NOPC)), |
| 345 | 345 | ||
| 346 | /* MOV (reg-shift reg) cccc 0001 101x xxxx xxxx xxxx 0xx1 xxxx */ | 346 | /* MOV (reg-shift reg) cccc 0001 101x xxxx xxxx xxxx 0xx1 xxxx */ |
| 347 | /* MVN (reg-shift reg) cccc 0001 111x xxxx xxxx xxxx 0xx1 xxxx */ | 347 | /* MVN (reg-shift reg) cccc 0001 111x xxxx xxxx xxxx 0xx1 xxxx */ |
| 348 | DECODE_EMULATEX (0x0fa00090, 0x01a00010, PROBES_DATA_PROCESSING_REG, | 348 | DECODE_EMULATEX (0x0fa00090, 0x01a00010, PROBES_DATA_PROCESSING_REG, |
| 349 | REGS(0, ANY, NOPC, 0, ANY)), | 349 | REGS(0, NOPC, NOPC, 0, NOPC)), |
| 350 | 350 | ||
| 351 | /* AND (reg-shift reg) cccc 0000 000x xxxx xxxx xxxx 0xx1 xxxx */ | 351 | /* AND (reg-shift reg) cccc 0000 000x xxxx xxxx xxxx 0xx1 xxxx */ |
| 352 | /* EOR (reg-shift reg) cccc 0000 001x xxxx xxxx xxxx 0xx1 xxxx */ | 352 | /* EOR (reg-shift reg) cccc 0000 001x xxxx xxxx xxxx 0xx1 xxxx */ |
| @@ -359,7 +359,7 @@ static const union decode_item arm_cccc_000x_table[] = { | |||
| 359 | /* ORR (reg-shift reg) cccc 0001 100x xxxx xxxx xxxx 0xx1 xxxx */ | 359 | /* ORR (reg-shift reg) cccc 0001 100x xxxx xxxx xxxx 0xx1 xxxx */ |
| 360 | /* BIC (reg-shift reg) cccc 0001 110x xxxx xxxx xxxx 0xx1 xxxx */ | 360 | /* BIC (reg-shift reg) cccc 0001 110x xxxx xxxx xxxx 0xx1 xxxx */ |
| 361 | DECODE_EMULATEX (0x0e000090, 0x00000010, PROBES_DATA_PROCESSING_REG, | 361 | DECODE_EMULATEX (0x0e000090, 0x00000010, PROBES_DATA_PROCESSING_REG, |
| 362 | REGS(ANY, ANY, NOPC, 0, ANY)), | 362 | REGS(NOPC, NOPC, NOPC, 0, NOPC)), |
| 363 | 363 | ||
| 364 | DECODE_END | 364 | DECODE_END |
| 365 | }; | 365 | }; |
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index f38cf7c110cc..46d893fcbe85 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c | |||
| @@ -173,10 +173,8 @@ static struct platform_device exynos_cpuidle = { | |||
| 173 | 173 | ||
| 174 | void __init exynos_cpuidle_init(void) | 174 | void __init exynos_cpuidle_init(void) |
| 175 | { | 175 | { |
| 176 | if (soc_is_exynos5440()) | 176 | if (soc_is_exynos4210() || soc_is_exynos5250()) |
| 177 | return; | 177 | platform_device_register(&exynos_cpuidle); |
| 178 | |||
| 179 | platform_device_register(&exynos_cpuidle); | ||
| 180 | } | 178 | } |
| 181 | 179 | ||
| 182 | void __init exynos_cpufreq_init(void) | 180 | void __init exynos_cpufreq_init(void) |
| @@ -297,7 +295,7 @@ static void __init exynos_dt_machine_init(void) | |||
| 297 | * This is called from smp_prepare_cpus if we've built for SMP, but | 295 | * This is called from smp_prepare_cpus if we've built for SMP, but |
| 298 | * we still need to set it up for PM and firmware ops if not. | 296 | * we still need to set it up for PM and firmware ops if not. |
| 299 | */ | 297 | */ |
| 300 | if (!IS_ENABLED(SMP)) | 298 | if (!IS_ENABLED(CONFIG_SMP)) |
| 301 | exynos_sysram_init(); | 299 | exynos_sysram_init(); |
| 302 | 300 | ||
| 303 | exynos_cpuidle_init(); | 301 | exynos_cpuidle_init(); |
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c index eb91d2350f8c..e8797bb78871 100644 --- a/arch/arm/mach-exynos/firmware.c +++ b/arch/arm/mach-exynos/firmware.c | |||
| @@ -57,8 +57,13 @@ static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr) | |||
| 57 | 57 | ||
| 58 | boot_reg = sysram_ns_base_addr + 0x1c; | 58 | boot_reg = sysram_ns_base_addr + 0x1c; |
| 59 | 59 | ||
| 60 | if (!soc_is_exynos4212() && !soc_is_exynos3250()) | 60 | /* |
| 61 | boot_reg += 4*cpu; | 61 | * Almost all Exynos-series of SoCs that run in secure mode don't need |
| 62 | * additional offset for every CPU, with Exynos4412 being the only | ||
| 63 | * exception. | ||
| 64 | */ | ||
| 65 | if (soc_is_exynos4412()) | ||
| 66 | boot_reg += 4 * cpu; | ||
| 62 | 67 | ||
| 63 | __raw_writel(boot_addr, boot_reg); | 68 | __raw_writel(boot_addr, boot_reg); |
| 64 | return 0; | 69 | return 0; |
diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c index fe6570ebbdde..797cb134bfff 100644 --- a/arch/arm/mach-exynos/pm_domains.c +++ b/arch/arm/mach-exynos/pm_domains.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
| 18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
| 19 | #include <linux/pm_domain.h> | 19 | #include <linux/pm_domain.h> |
| 20 | #include <linux/clk.h> | ||
| 20 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
| 21 | #include <linux/of_address.h> | 22 | #include <linux/of_address.h> |
| 22 | #include <linux/of_platform.h> | 23 | #include <linux/of_platform.h> |
| @@ -24,6 +25,8 @@ | |||
| 24 | 25 | ||
| 25 | #include "regs-pmu.h" | 26 | #include "regs-pmu.h" |
| 26 | 27 | ||
| 28 | #define MAX_CLK_PER_DOMAIN 4 | ||
| 29 | |||
| 27 | /* | 30 | /* |
| 28 | * Exynos specific wrapper around the generic power domain | 31 | * Exynos specific wrapper around the generic power domain |
| 29 | */ | 32 | */ |
| @@ -32,6 +35,9 @@ struct exynos_pm_domain { | |||
| 32 | char const *name; | 35 | char const *name; |
| 33 | bool is_off; | 36 | bool is_off; |
| 34 | struct generic_pm_domain pd; | 37 | struct generic_pm_domain pd; |
| 38 | struct clk *oscclk; | ||
| 39 | struct clk *clk[MAX_CLK_PER_DOMAIN]; | ||
| 40 | struct clk *pclk[MAX_CLK_PER_DOMAIN]; | ||
| 35 | }; | 41 | }; |
| 36 | 42 | ||
| 37 | static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) | 43 | static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) |
| @@ -44,6 +50,19 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) | |||
| 44 | pd = container_of(domain, struct exynos_pm_domain, pd); | 50 | pd = container_of(domain, struct exynos_pm_domain, pd); |
| 45 | base = pd->base; | 51 | base = pd->base; |
| 46 | 52 | ||
| 53 | /* Set oscclk before powering off a domain*/ | ||
| 54 | if (!power_on) { | ||
| 55 | int i; | ||
| 56 | |||
| 57 | for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { | ||
| 58 | if (IS_ERR(pd->clk[i])) | ||
| 59 | break; | ||
| 60 | if (clk_set_parent(pd->clk[i], pd->oscclk)) | ||
| 61 | pr_err("%s: error setting oscclk as parent to clock %d\n", | ||
| 62 | pd->name, i); | ||
| 63 | } | ||
| 64 | } | ||
| 65 | |||
| 47 | pwr = power_on ? S5P_INT_LOCAL_PWR_EN : 0; | 66 | pwr = power_on ? S5P_INT_LOCAL_PWR_EN : 0; |
| 48 | __raw_writel(pwr, base); | 67 | __raw_writel(pwr, base); |
| 49 | 68 | ||
| @@ -60,6 +79,20 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) | |||
| 60 | cpu_relax(); | 79 | cpu_relax(); |
| 61 | usleep_range(80, 100); | 80 | usleep_range(80, 100); |
| 62 | } | 81 | } |
| 82 | |||
| 83 | /* Restore clocks after powering on a domain*/ | ||
| 84 | if (power_on) { | ||
| 85 | int i; | ||
| 86 | |||
| 87 | for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { | ||
| 88 | if (IS_ERR(pd->clk[i])) | ||
| 89 | break; | ||
| 90 | if (clk_set_parent(pd->clk[i], pd->pclk[i])) | ||
| 91 | pr_err("%s: error setting parent to clock%d\n", | ||
| 92 | pd->name, i); | ||
| 93 | } | ||
| 94 | } | ||
| 95 | |||
| 63 | return 0; | 96 | return 0; |
| 64 | } | 97 | } |
| 65 | 98 | ||
| @@ -152,9 +185,11 @@ static __init int exynos4_pm_init_power_domain(void) | |||
| 152 | 185 | ||
| 153 | for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") { | 186 | for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") { |
| 154 | struct exynos_pm_domain *pd; | 187 | struct exynos_pm_domain *pd; |
| 155 | int on; | 188 | int on, i; |
| 189 | struct device *dev; | ||
| 156 | 190 | ||
| 157 | pdev = of_find_device_by_node(np); | 191 | pdev = of_find_device_by_node(np); |
| 192 | dev = &pdev->dev; | ||
| 158 | 193 | ||
| 159 | pd = kzalloc(sizeof(*pd), GFP_KERNEL); | 194 | pd = kzalloc(sizeof(*pd), GFP_KERNEL); |
| 160 | if (!pd) { | 195 | if (!pd) { |
| @@ -170,6 +205,30 @@ static __init int exynos4_pm_init_power_domain(void) | |||
| 170 | pd->pd.power_on = exynos_pd_power_on; | 205 | pd->pd.power_on = exynos_pd_power_on; |
| 171 | pd->pd.of_node = np; | 206 | pd->pd.of_node = np; |
| 172 | 207 | ||
| 208 | pd->oscclk = clk_get(dev, "oscclk"); | ||
| 209 | if (IS_ERR(pd->oscclk)) | ||
| 210 | goto no_clk; | ||
| 211 | |||
| 212 | for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { | ||
| 213 | char clk_name[8]; | ||
| 214 | |||
| 215 | snprintf(clk_name, sizeof(clk_name), "clk%d", i); | ||
| 216 | pd->clk[i] = clk_get(dev, clk_name); | ||
| 217 | if (IS_ERR(pd->clk[i])) | ||
| 218 | break; | ||
| 219 | snprintf(clk_name, sizeof(clk_name), "pclk%d", i); | ||
| 220 | pd->pclk[i] = clk_get(dev, clk_name); | ||
| 221 | if (IS_ERR(pd->pclk[i])) { | ||
| 222 | clk_put(pd->clk[i]); | ||
| 223 | pd->clk[i] = ERR_PTR(-EINVAL); | ||
| 224 | break; | ||
| 225 | } | ||
| 226 | } | ||
| 227 | |||
| 228 | if (IS_ERR(pd->clk[0])) | ||
| 229 | clk_put(pd->oscclk); | ||
| 230 | |||
| 231 | no_clk: | ||
| 173 | platform_set_drvdata(pdev, pd); | 232 | platform_set_drvdata(pdev, pd); |
| 174 | 233 | ||
| 175 | on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN; | 234 | on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN; |
diff --git a/arch/arm/mach-imx/clk-gate2.c b/arch/arm/mach-imx/clk-gate2.c index 4ba587da89d2..84acdfd1d715 100644 --- a/arch/arm/mach-imx/clk-gate2.c +++ b/arch/arm/mach-imx/clk-gate2.c | |||
| @@ -67,8 +67,12 @@ static void clk_gate2_disable(struct clk_hw *hw) | |||
| 67 | 67 | ||
| 68 | spin_lock_irqsave(gate->lock, flags); | 68 | spin_lock_irqsave(gate->lock, flags); |
| 69 | 69 | ||
| 70 | if (gate->share_count && --(*gate->share_count) > 0) | 70 | if (gate->share_count) { |
| 71 | goto out; | 71 | if (WARN_ON(*gate->share_count == 0)) |
| 72 | goto out; | ||
| 73 | else if (--(*gate->share_count) > 0) | ||
| 74 | goto out; | ||
| 75 | } | ||
| 72 | 76 | ||
| 73 | reg = readl(gate->reg); | 77 | reg = readl(gate->reg); |
| 74 | reg &= ~(3 << gate->bit_idx); | 78 | reg &= ~(3 << gate->bit_idx); |
| @@ -78,19 +82,26 @@ out: | |||
| 78 | spin_unlock_irqrestore(gate->lock, flags); | 82 | spin_unlock_irqrestore(gate->lock, flags); |
| 79 | } | 83 | } |
| 80 | 84 | ||
| 81 | static int clk_gate2_is_enabled(struct clk_hw *hw) | 85 | static int clk_gate2_reg_is_enabled(void __iomem *reg, u8 bit_idx) |
| 82 | { | 86 | { |
| 83 | u32 reg; | 87 | u32 val = readl(reg); |
| 84 | struct clk_gate2 *gate = to_clk_gate2(hw); | ||
| 85 | 88 | ||
| 86 | reg = readl(gate->reg); | 89 | if (((val >> bit_idx) & 1) == 1) |
| 87 | |||
| 88 | if (((reg >> gate->bit_idx) & 1) == 1) | ||
| 89 | return 1; | 90 | return 1; |
| 90 | 91 | ||
| 91 | return 0; | 92 | return 0; |
| 92 | } | 93 | } |
| 93 | 94 | ||
| 95 | static int clk_gate2_is_enabled(struct clk_hw *hw) | ||
| 96 | { | ||
| 97 | struct clk_gate2 *gate = to_clk_gate2(hw); | ||
| 98 | |||
| 99 | if (gate->share_count) | ||
| 100 | return !!(*gate->share_count); | ||
| 101 | else | ||
| 102 | return clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx); | ||
| 103 | } | ||
| 104 | |||
| 94 | static struct clk_ops clk_gate2_ops = { | 105 | static struct clk_ops clk_gate2_ops = { |
| 95 | .enable = clk_gate2_enable, | 106 | .enable = clk_gate2_enable, |
| 96 | .disable = clk_gate2_disable, | 107 | .disable = clk_gate2_disable, |
| @@ -116,6 +127,10 @@ struct clk *clk_register_gate2(struct device *dev, const char *name, | |||
| 116 | gate->bit_idx = bit_idx; | 127 | gate->bit_idx = bit_idx; |
| 117 | gate->flags = clk_gate2_flags; | 128 | gate->flags = clk_gate2_flags; |
| 118 | gate->lock = lock; | 129 | gate->lock = lock; |
| 130 | |||
| 131 | /* Initialize share_count per hardware state */ | ||
| 132 | if (share_count) | ||
| 133 | *share_count = clk_gate2_reg_is_enabled(reg, bit_idx) ? 1 : 0; | ||
| 119 | gate->share_count = share_count; | 134 | gate->share_count = share_count; |
| 120 | 135 | ||
| 121 | init.name = name; | 136 | init.name = name; |
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c index 332af927f4d3..67fd26a18441 100644 --- a/arch/arm/mach-omap2/clkt_dpll.c +++ b/arch/arm/mach-omap2/clkt_dpll.c | |||
| @@ -76,7 +76,7 @@ | |||
| 76 | * (assuming that it is counting N upwards), or -2 if the enclosing loop | 76 | * (assuming that it is counting N upwards), or -2 if the enclosing loop |
| 77 | * should skip to the next iteration (again assuming N is increasing). | 77 | * should skip to the next iteration (again assuming N is increasing). |
| 78 | */ | 78 | */ |
| 79 | static int _dpll_test_fint(struct clk_hw_omap *clk, u8 n) | 79 | static int _dpll_test_fint(struct clk_hw_omap *clk, unsigned int n) |
| 80 | { | 80 | { |
| 81 | struct dpll_data *dd; | 81 | struct dpll_data *dd; |
| 82 | long fint, fint_min, fint_max; | 82 | long fint, fint_min, fint_max; |
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h index 04dab2fcf862..ee6c784cd6b7 100644 --- a/arch/arm/mach-omap2/cm-regbits-34xx.h +++ b/arch/arm/mach-omap2/cm-regbits-34xx.h | |||
| @@ -26,11 +26,14 @@ | |||
| 26 | #define OMAP3430_EN_WDT3_SHIFT 12 | 26 | #define OMAP3430_EN_WDT3_SHIFT 12 |
| 27 | #define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_MASK (1 << 0) | 27 | #define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_MASK (1 << 0) |
| 28 | #define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT 0 | 28 | #define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT 0 |
| 29 | #define OMAP3430_IVA2_DPLL_FREQSEL_SHIFT 4 | ||
| 29 | #define OMAP3430_IVA2_DPLL_FREQSEL_MASK (0xf << 4) | 30 | #define OMAP3430_IVA2_DPLL_FREQSEL_MASK (0xf << 4) |
| 30 | #define OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_SHIFT 3 | 31 | #define OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_SHIFT 3 |
| 32 | #define OMAP3430_EN_IVA2_DPLL_SHIFT 0 | ||
| 31 | #define OMAP3430_EN_IVA2_DPLL_MASK (0x7 << 0) | 33 | #define OMAP3430_EN_IVA2_DPLL_MASK (0x7 << 0) |
| 32 | #define OMAP3430_ST_IVA2_SHIFT 0 | 34 | #define OMAP3430_ST_IVA2_SHIFT 0 |
| 33 | #define OMAP3430_ST_IVA2_CLK_MASK (1 << 0) | 35 | #define OMAP3430_ST_IVA2_CLK_MASK (1 << 0) |
| 36 | #define OMAP3430_AUTO_IVA2_DPLL_SHIFT 0 | ||
| 34 | #define OMAP3430_AUTO_IVA2_DPLL_MASK (0x7 << 0) | 37 | #define OMAP3430_AUTO_IVA2_DPLL_MASK (0x7 << 0) |
| 35 | #define OMAP3430_IVA2_CLK_SRC_SHIFT 19 | 38 | #define OMAP3430_IVA2_CLK_SRC_SHIFT 19 |
| 36 | #define OMAP3430_IVA2_CLK_SRC_WIDTH 3 | 39 | #define OMAP3430_IVA2_CLK_SRC_WIDTH 3 |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index b2d252bf4a53..dc571f1d3b8a 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
| @@ -162,7 +162,8 @@ static inline void omap3xxx_restart(enum reboot_mode mode, const char *cmd) | |||
| 162 | } | 162 | } |
| 163 | #endif | 163 | #endif |
| 164 | 164 | ||
| 165 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) | 165 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ |
| 166 | defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX) | ||
| 166 | void omap44xx_restart(enum reboot_mode mode, const char *cmd); | 167 | void omap44xx_restart(enum reboot_mode mode, const char *cmd); |
| 167 | #else | 168 | #else |
| 168 | static inline void omap44xx_restart(enum reboot_mode mode, const char *cmd) | 169 | static inline void omap44xx_restart(enum reboot_mode mode, const char *cmd) |
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 592ba0a0ecf3..b6f8f348296e 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
| @@ -297,33 +297,6 @@ static void omap_init_audio(void) | |||
| 297 | static inline void omap_init_audio(void) {} | 297 | static inline void omap_init_audio(void) {} |
| 298 | #endif | 298 | #endif |
| 299 | 299 | ||
| 300 | #if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI) || \ | ||
| 301 | defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE) | ||
| 302 | |||
| 303 | static struct platform_device omap_hdmi_audio = { | ||
| 304 | .name = "omap-hdmi-audio", | ||
| 305 | .id = -1, | ||
| 306 | }; | ||
| 307 | |||
| 308 | static void __init omap_init_hdmi_audio(void) | ||
| 309 | { | ||
| 310 | struct omap_hwmod *oh; | ||
| 311 | struct platform_device *pdev; | ||
| 312 | |||
| 313 | oh = omap_hwmod_lookup("dss_hdmi"); | ||
| 314 | if (!oh) | ||
| 315 | return; | ||
| 316 | |||
| 317 | pdev = omap_device_build("omap-hdmi-audio-dai", -1, oh, NULL, 0); | ||
| 318 | WARN(IS_ERR(pdev), | ||
| 319 | "Can't build omap_device for omap-hdmi-audio-dai.\n"); | ||
| 320 | |||
| 321 | platform_device_register(&omap_hdmi_audio); | ||
| 322 | } | ||
| 323 | #else | ||
| 324 | static inline void omap_init_hdmi_audio(void) {} | ||
| 325 | #endif | ||
| 326 | |||
| 327 | #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) | 300 | #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) |
| 328 | 301 | ||
| 329 | #include <linux/platform_data/spi-omap2-mcspi.h> | 302 | #include <linux/platform_data/spi-omap2-mcspi.h> |
| @@ -459,7 +432,6 @@ static int __init omap2_init_devices(void) | |||
| 459 | */ | 432 | */ |
| 460 | omap_init_audio(); | 433 | omap_init_audio(); |
| 461 | omap_init_camera(); | 434 | omap_init_camera(); |
| 462 | omap_init_hdmi_audio(); | ||
| 463 | omap_init_mbox(); | 435 | omap_init_mbox(); |
| 464 | /* If dtb is there, the devices will be created dynamically */ | 436 | /* If dtb is there, the devices will be created dynamically */ |
| 465 | if (!of_have_populated_dt()) { | 437 | if (!of_have_populated_dt()) { |
diff --git a/arch/arm/mach-omap2/dsp.c b/arch/arm/mach-omap2/dsp.c index b8208b4b1bd9..f7492df1cbba 100644 --- a/arch/arm/mach-omap2/dsp.c +++ b/arch/arm/mach-omap2/dsp.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #ifdef CONFIG_TIDSPBRIDGE_DVFS | 29 | #ifdef CONFIG_TIDSPBRIDGE_DVFS |
| 30 | #include "omap-pm.h" | 30 | #include "omap-pm.h" |
| 31 | #endif | 31 | #endif |
| 32 | #include "soc.h" | ||
| 32 | 33 | ||
| 33 | #include <linux/platform_data/dsp-omap.h> | 34 | #include <linux/platform_data/dsp-omap.h> |
| 34 | 35 | ||
| @@ -59,6 +60,9 @@ void __init omap_dsp_reserve_sdram_memblock(void) | |||
| 59 | phys_addr_t size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE; | 60 | phys_addr_t size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE; |
| 60 | phys_addr_t paddr; | 61 | phys_addr_t paddr; |
| 61 | 62 | ||
| 63 | if (!cpu_is_omap34xx()) | ||
| 64 | return; | ||
| 65 | |||
| 62 | if (!size) | 66 | if (!size) |
| 63 | return; | 67 | return; |
| 64 | 68 | ||
| @@ -83,6 +87,9 @@ static int __init omap_dsp_init(void) | |||
| 83 | int err = -ENOMEM; | 87 | int err = -ENOMEM; |
| 84 | struct omap_dsp_platform_data *pdata = &omap_dsp_pdata; | 88 | struct omap_dsp_platform_data *pdata = &omap_dsp_pdata; |
| 85 | 89 | ||
| 90 | if (!cpu_is_omap34xx()) | ||
| 91 | return 0; | ||
| 92 | |||
| 86 | pdata->phys_mempool_base = omap_dsp_get_mempool_base(); | 93 | pdata->phys_mempool_base = omap_dsp_get_mempool_base(); |
| 87 | 94 | ||
| 88 | if (pdata->phys_mempool_base) { | 95 | if (pdata->phys_mempool_base) { |
| @@ -115,6 +122,9 @@ module_init(omap_dsp_init); | |||
| 115 | 122 | ||
| 116 | static void __exit omap_dsp_exit(void) | 123 | static void __exit omap_dsp_exit(void) |
| 117 | { | 124 | { |
| 125 | if (!cpu_is_omap34xx()) | ||
| 126 | return; | ||
| 127 | |||
| 118 | platform_device_unregister(omap_dsp_pdev); | 128 | platform_device_unregister(omap_dsp_pdev); |
| 119 | } | 129 | } |
| 120 | module_exit(omap_dsp_exit); | 130 | module_exit(omap_dsp_exit); |
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 2c0c2816900f..8bc13380f0a0 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
| @@ -1615,7 +1615,7 @@ static int gpmc_probe_dt(struct platform_device *pdev) | |||
| 1615 | return ret; | 1615 | return ret; |
| 1616 | } | 1616 | } |
| 1617 | 1617 | ||
| 1618 | for_each_child_of_node(pdev->dev.of_node, child) { | 1618 | for_each_available_child_of_node(pdev->dev.of_node, child) { |
| 1619 | 1619 | ||
| 1620 | if (!child->name) | 1620 | if (!child->name) |
| 1621 | continue; | 1621 | continue; |
diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c index 20b4398cec05..284324f2b98a 100644 --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c | |||
| @@ -1268,9 +1268,6 @@ static struct omap_hwmod_class dra7xx_sata_hwmod_class = { | |||
| 1268 | }; | 1268 | }; |
| 1269 | 1269 | ||
| 1270 | /* sata */ | 1270 | /* sata */ |
| 1271 | static struct omap_hwmod_opt_clk sata_opt_clks[] = { | ||
| 1272 | { .role = "ref_clk", .clk = "sata_ref_clk" }, | ||
| 1273 | }; | ||
| 1274 | 1271 | ||
| 1275 | static struct omap_hwmod dra7xx_sata_hwmod = { | 1272 | static struct omap_hwmod dra7xx_sata_hwmod = { |
| 1276 | .name = "sata", | 1273 | .name = "sata", |
| @@ -1278,6 +1275,7 @@ static struct omap_hwmod dra7xx_sata_hwmod = { | |||
| 1278 | .clkdm_name = "l3init_clkdm", | 1275 | .clkdm_name = "l3init_clkdm", |
| 1279 | .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY, | 1276 | .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY, |
| 1280 | .main_clk = "func_48m_fclk", | 1277 | .main_clk = "func_48m_fclk", |
| 1278 | .mpu_rt_idx = 1, | ||
| 1281 | .prcm = { | 1279 | .prcm = { |
| 1282 | .omap4 = { | 1280 | .omap4 = { |
| 1283 | .clkctrl_offs = DRA7XX_CM_L3INIT_SATA_CLKCTRL_OFFSET, | 1281 | .clkctrl_offs = DRA7XX_CM_L3INIT_SATA_CLKCTRL_OFFSET, |
| @@ -1285,8 +1283,6 @@ static struct omap_hwmod dra7xx_sata_hwmod = { | |||
| 1285 | .modulemode = MODULEMODE_SWCTRL, | 1283 | .modulemode = MODULEMODE_SWCTRL, |
| 1286 | }, | 1284 | }, |
| 1287 | }, | 1285 | }, |
| 1288 | .opt_clks = sata_opt_clks, | ||
| 1289 | .opt_clks_cnt = ARRAY_SIZE(sata_opt_clks), | ||
| 1290 | }; | 1286 | }; |
| 1291 | 1287 | ||
| 1292 | /* | 1288 | /* |
| @@ -1731,8 +1727,20 @@ static struct omap_hwmod dra7xx_uart6_hwmod = { | |||
| 1731 | * | 1727 | * |
| 1732 | */ | 1728 | */ |
| 1733 | 1729 | ||
| 1730 | static struct omap_hwmod_class_sysconfig dra7xx_usb_otg_ss_sysc = { | ||
| 1731 | .rev_offs = 0x0000, | ||
| 1732 | .sysc_offs = 0x0010, | ||
| 1733 | .sysc_flags = (SYSC_HAS_DMADISABLE | SYSC_HAS_MIDLEMODE | | ||
| 1734 | SYSC_HAS_SIDLEMODE), | ||
| 1735 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | ||
| 1736 | SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | | ||
| 1737 | MSTANDBY_SMART | MSTANDBY_SMART_WKUP), | ||
| 1738 | .sysc_fields = &omap_hwmod_sysc_type2, | ||
| 1739 | }; | ||
| 1740 | |||
| 1734 | static struct omap_hwmod_class dra7xx_usb_otg_ss_hwmod_class = { | 1741 | static struct omap_hwmod_class dra7xx_usb_otg_ss_hwmod_class = { |
| 1735 | .name = "usb_otg_ss", | 1742 | .name = "usb_otg_ss", |
| 1743 | .sysc = &dra7xx_usb_otg_ss_sysc, | ||
| 1736 | }; | 1744 | }; |
| 1737 | 1745 | ||
| 1738 | /* usb_otg_ss1 */ | 1746 | /* usb_otg_ss1 */ |
diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h b/arch/arm/mach-omap2/prm-regbits-34xx.h index 106132db532b..cbefbd7cfdb5 100644 --- a/arch/arm/mach-omap2/prm-regbits-34xx.h +++ b/arch/arm/mach-omap2/prm-regbits-34xx.h | |||
| @@ -35,6 +35,8 @@ | |||
| 35 | #define OMAP3430_LOGICSTATEST_MASK (1 << 2) | 35 | #define OMAP3430_LOGICSTATEST_MASK (1 << 2) |
| 36 | #define OMAP3430_LASTLOGICSTATEENTERED_MASK (1 << 2) | 36 | #define OMAP3430_LASTLOGICSTATEENTERED_MASK (1 << 2) |
| 37 | #define OMAP3430_LASTPOWERSTATEENTERED_MASK (0x3 << 0) | 37 | #define OMAP3430_LASTPOWERSTATEENTERED_MASK (0x3 << 0) |
| 38 | #define OMAP3430_GRPSEL_MCBSP5_MASK (1 << 10) | ||
| 39 | #define OMAP3430_GRPSEL_MCBSP1_MASK (1 << 9) | ||
| 38 | #define OMAP3630_GRPSEL_UART4_MASK (1 << 18) | 40 | #define OMAP3630_GRPSEL_UART4_MASK (1 << 18) |
| 39 | #define OMAP3430_GRPSEL_GPIO6_MASK (1 << 17) | 41 | #define OMAP3430_GRPSEL_GPIO6_MASK (1 << 17) |
| 40 | #define OMAP3430_GRPSEL_GPIO5_MASK (1 << 16) | 42 | #define OMAP3430_GRPSEL_GPIO5_MASK (1 << 16) |
| @@ -42,6 +44,10 @@ | |||
| 42 | #define OMAP3430_GRPSEL_GPIO3_MASK (1 << 14) | 44 | #define OMAP3430_GRPSEL_GPIO3_MASK (1 << 14) |
| 43 | #define OMAP3430_GRPSEL_GPIO2_MASK (1 << 13) | 45 | #define OMAP3430_GRPSEL_GPIO2_MASK (1 << 13) |
| 44 | #define OMAP3430_GRPSEL_UART3_MASK (1 << 11) | 46 | #define OMAP3430_GRPSEL_UART3_MASK (1 << 11) |
| 47 | #define OMAP3430_GRPSEL_GPT8_MASK (1 << 9) | ||
| 48 | #define OMAP3430_GRPSEL_GPT7_MASK (1 << 8) | ||
| 49 | #define OMAP3430_GRPSEL_GPT6_MASK (1 << 7) | ||
| 50 | #define OMAP3430_GRPSEL_GPT5_MASK (1 << 6) | ||
| 45 | #define OMAP3430_GRPSEL_MCBSP4_MASK (1 << 2) | 51 | #define OMAP3430_GRPSEL_MCBSP4_MASK (1 << 2) |
| 46 | #define OMAP3430_GRPSEL_MCBSP3_MASK (1 << 1) | 52 | #define OMAP3430_GRPSEL_MCBSP3_MASK (1 << 1) |
| 47 | #define OMAP3430_GRPSEL_MCBSP2_MASK (1 << 0) | 53 | #define OMAP3430_GRPSEL_MCBSP2_MASK (1 << 0) |
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 076172b69422..7c3fb41a462e 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
| @@ -664,7 +664,7 @@ static int l2c310_cpu_enable_flz(struct notifier_block *nb, unsigned long act, v | |||
| 664 | 664 | ||
| 665 | static void __init l2c310_enable(void __iomem *base, u32 aux, unsigned num_lock) | 665 | static void __init l2c310_enable(void __iomem *base, u32 aux, unsigned num_lock) |
| 666 | { | 666 | { |
| 667 | unsigned rev = readl_relaxed(base + L2X0_CACHE_ID) & L2X0_CACHE_ID_PART_MASK; | 667 | unsigned rev = readl_relaxed(base + L2X0_CACHE_ID) & L2X0_CACHE_ID_RTL_MASK; |
| 668 | bool cortex_a9 = read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9; | 668 | bool cortex_a9 = read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9; |
| 669 | 669 | ||
| 670 | if (rev >= L310_CACHE_ID_RTL_R2P0) { | 670 | if (rev >= L310_CACHE_ID_RTL_R2P0) { |
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 993bce527b85..902eb708804a 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h | |||
| @@ -56,6 +56,8 @@ | |||
| 56 | #define TASK_SIZE_32 UL(0x100000000) | 56 | #define TASK_SIZE_32 UL(0x100000000) |
| 57 | #define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \ | 57 | #define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \ |
| 58 | TASK_SIZE_32 : TASK_SIZE_64) | 58 | TASK_SIZE_32 : TASK_SIZE_64) |
| 59 | #define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT) ? \ | ||
| 60 | TASK_SIZE_32 : TASK_SIZE_64) | ||
| 59 | #else | 61 | #else |
| 60 | #define TASK_SIZE TASK_SIZE_64 | 62 | #define TASK_SIZE TASK_SIZE_64 |
| 61 | #endif /* CONFIG_COMPAT */ | 63 | #endif /* CONFIG_COMPAT */ |
diff --git a/arch/arm64/mm/copypage.c b/arch/arm64/mm/copypage.c index 9aecbace4128..13bbc3be6f5a 100644 --- a/arch/arm64/mm/copypage.c +++ b/arch/arm64/mm/copypage.c | |||
| @@ -27,8 +27,10 @@ void __cpu_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr) | |||
| 27 | copy_page(kto, kfrom); | 27 | copy_page(kto, kfrom); |
| 28 | __flush_dcache_area(kto, PAGE_SIZE); | 28 | __flush_dcache_area(kto, PAGE_SIZE); |
| 29 | } | 29 | } |
| 30 | EXPORT_SYMBOL_GPL(__cpu_copy_user_page); | ||
| 30 | 31 | ||
| 31 | void __cpu_clear_user_page(void *kaddr, unsigned long vaddr) | 32 | void __cpu_clear_user_page(void *kaddr, unsigned long vaddr) |
| 32 | { | 33 | { |
| 33 | clear_page(kaddr); | 34 | clear_page(kaddr); |
| 34 | } | 35 | } |
| 36 | EXPORT_SYMBOL_GPL(__cpu_clear_user_page); | ||
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index dbb118e1a4e0..a54788458ca3 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S | |||
| @@ -921,7 +921,8 @@ L(nocon): | |||
| 921 | jls 1f | 921 | jls 1f |
| 922 | lsrl #1,%d1 | 922 | lsrl #1,%d1 |
| 923 | 1: | 923 | 1: |
| 924 | movel %d1,m68k_init_mapped_size | 924 | lea %pc@(m68k_init_mapped_size),%a0 |
| 925 | movel %d1,%a0@ | ||
| 925 | mmu_map #PAGE_OFFSET,%pc@(L(phys_kernel_start)),%d1,\ | 926 | mmu_map #PAGE_OFFSET,%pc@(L(phys_kernel_start)),%d1,\ |
| 926 | %pc@(m68k_supervisor_cachemode) | 927 | %pc@(m68k_supervisor_cachemode) |
| 927 | 928 | ||
diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c index 958f1adb9d0c..3857737e3958 100644 --- a/arch/m68k/kernel/time.c +++ b/arch/m68k/kernel/time.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
| 14 | #include <linux/export.h> | ||
| 14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 15 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 16 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
| @@ -30,6 +31,7 @@ | |||
| 30 | 31 | ||
| 31 | 32 | ||
| 32 | unsigned long (*mach_random_get_entropy)(void); | 33 | unsigned long (*mach_random_get_entropy)(void); |
| 34 | EXPORT_SYMBOL_GPL(mach_random_get_entropy); | ||
| 33 | 35 | ||
| 34 | 36 | ||
| 35 | /* | 37 | /* |
diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c index 608716f8496b..af3bc359dc70 100644 --- a/arch/parisc/kernel/hardware.c +++ b/arch/parisc/kernel/hardware.c | |||
| @@ -1210,7 +1210,8 @@ static struct hp_hardware hp_hardware_list[] = { | |||
| 1210 | {HPHW_FIO, 0x004, 0x00320, 0x0, "Metheus Frame Buffer"}, | 1210 | {HPHW_FIO, 0x004, 0x00320, 0x0, "Metheus Frame Buffer"}, |
| 1211 | {HPHW_FIO, 0x004, 0x00340, 0x0, "BARCO CX4500 VME Grphx Cnsl"}, | 1211 | {HPHW_FIO, 0x004, 0x00340, 0x0, "BARCO CX4500 VME Grphx Cnsl"}, |
| 1212 | {HPHW_FIO, 0x004, 0x00360, 0x0, "Hughes TOG VME FDDI"}, | 1212 | {HPHW_FIO, 0x004, 0x00360, 0x0, "Hughes TOG VME FDDI"}, |
| 1213 | {HPHW_FIO, 0x076, 0x000AD, 0x00, "Crestone Peak RS-232"}, | 1213 | {HPHW_FIO, 0x076, 0x000AD, 0x0, "Crestone Peak Core RS-232"}, |
| 1214 | {HPHW_FIO, 0x077, 0x000AD, 0x0, "Crestone Peak Fast? Core RS-232"}, | ||
| 1214 | {HPHW_IOA, 0x185, 0x0000B, 0x00, "Java BC Summit Port"}, | 1215 | {HPHW_IOA, 0x185, 0x0000B, 0x00, "Java BC Summit Port"}, |
| 1215 | {HPHW_IOA, 0x1FF, 0x0000B, 0x00, "Hitachi Ghostview Summit Port"}, | 1216 | {HPHW_IOA, 0x1FF, 0x0000B, 0x00, "Hitachi Ghostview Summit Port"}, |
| 1216 | {HPHW_IOA, 0x580, 0x0000B, 0x10, "U2-IOA BC Runway Port"}, | 1217 | {HPHW_IOA, 0x580, 0x0000B, 0x10, "U2-IOA BC Runway Port"}, |
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index bb9f3b64de55..93c1963d76fe 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | * Copyright (C) 2000-2001 Hewlett Packard Company | 4 | * Copyright (C) 2000-2001 Hewlett Packard Company |
| 5 | * Copyright (C) 2000 John Marvin | 5 | * Copyright (C) 2000 John Marvin |
| 6 | * Copyright (C) 2001 Matthew Wilcox | 6 | * Copyright (C) 2001 Matthew Wilcox |
| 7 | * Copyright (C) 2014 Helge Deller <deller@gmx.de> | ||
| 7 | * | 8 | * |
| 8 | * These routines maintain argument size conversion between 32bit and 64bit | 9 | * These routines maintain argument size conversion between 32bit and 64bit |
| 9 | * environment. Based heavily on sys_ia32.c and sys_sparc32.c. | 10 | * environment. Based heavily on sys_ia32.c and sys_sparc32.c. |
| @@ -11,44 +12,8 @@ | |||
| 11 | 12 | ||
| 12 | #include <linux/compat.h> | 13 | #include <linux/compat.h> |
| 13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 14 | #include <linux/sched.h> | ||
| 15 | #include <linux/fs.h> | ||
| 16 | #include <linux/mm.h> | ||
| 17 | #include <linux/file.h> | ||
| 18 | #include <linux/signal.h> | ||
| 19 | #include <linux/resource.h> | ||
| 20 | #include <linux/times.h> | ||
| 21 | #include <linux/time.h> | ||
| 22 | #include <linux/smp.h> | ||
| 23 | #include <linux/sem.h> | ||
| 24 | #include <linux/shm.h> | ||
| 25 | #include <linux/slab.h> | ||
| 26 | #include <linux/uio.h> | ||
| 27 | #include <linux/ncp_fs.h> | ||
| 28 | #include <linux/poll.h> | ||
| 29 | #include <linux/personality.h> | ||
| 30 | #include <linux/stat.h> | ||
| 31 | #include <linux/highmem.h> | ||
| 32 | #include <linux/highuid.h> | ||
| 33 | #include <linux/mman.h> | ||
| 34 | #include <linux/binfmts.h> | ||
| 35 | #include <linux/namei.h> | ||
| 36 | #include <linux/vfs.h> | ||
| 37 | #include <linux/ptrace.h> | ||
| 38 | #include <linux/swap.h> | ||
| 39 | #include <linux/syscalls.h> | 15 | #include <linux/syscalls.h> |
| 40 | 16 | ||
| 41 | #include <asm/types.h> | ||
| 42 | #include <asm/uaccess.h> | ||
| 43 | #include <asm/mmu_context.h> | ||
| 44 | |||
| 45 | #undef DEBUG | ||
| 46 | |||
| 47 | #ifdef DEBUG | ||
| 48 | #define DBG(x) printk x | ||
| 49 | #else | ||
| 50 | #define DBG(x) | ||
| 51 | #endif | ||
| 52 | 17 | ||
| 53 | asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23, | 18 | asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23, |
| 54 | int r22, int r21, int r20) | 19 | int r22, int r21, int r20) |
| @@ -57,3 +22,12 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23, | |||
| 57 | current->comm, current->pid, r20); | 22 | current->comm, current->pid, r20); |
| 58 | return -ENOSYS; | 23 | return -ENOSYS; |
| 59 | } | 24 | } |
| 25 | |||
| 26 | asmlinkage long sys32_fanotify_mark(compat_int_t fanotify_fd, compat_uint_t flags, | ||
| 27 | compat_uint_t mask0, compat_uint_t mask1, compat_int_t dfd, | ||
| 28 | const char __user * pathname) | ||
| 29 | { | ||
| 30 | return sys_fanotify_mark(fanotify_fd, flags, | ||
| 31 | ((__u64)mask1 << 32) | mask0, | ||
| 32 | dfd, pathname); | ||
| 33 | } | ||
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index c5fa7a697fba..84c5d3a58fa1 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S | |||
| @@ -418,7 +418,7 @@ | |||
| 418 | ENTRY_SAME(accept4) /* 320 */ | 418 | ENTRY_SAME(accept4) /* 320 */ |
| 419 | ENTRY_SAME(prlimit64) | 419 | ENTRY_SAME(prlimit64) |
| 420 | ENTRY_SAME(fanotify_init) | 420 | ENTRY_SAME(fanotify_init) |
| 421 | ENTRY_COMP(fanotify_mark) | 421 | ENTRY_DIFF(fanotify_mark) |
| 422 | ENTRY_COMP(clock_adjtime) | 422 | ENTRY_COMP(clock_adjtime) |
| 423 | ENTRY_SAME(name_to_handle_at) /* 325 */ | 423 | ENTRY_SAME(name_to_handle_at) /* 325 */ |
| 424 | ENTRY_COMP(open_by_handle_at) | 424 | ENTRY_COMP(open_by_handle_at) |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index bd6dd6ed3a9f..fefe7c8bf05f 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
| @@ -414,7 +414,7 @@ config KEXEC | |||
| 414 | config CRASH_DUMP | 414 | config CRASH_DUMP |
| 415 | bool "Build a kdump crash kernel" | 415 | bool "Build a kdump crash kernel" |
| 416 | depends on PPC64 || 6xx || FSL_BOOKE || (44x && !SMP) | 416 | depends on PPC64 || 6xx || FSL_BOOKE || (44x && !SMP) |
| 417 | select RELOCATABLE if PPC64 || 44x || FSL_BOOKE | 417 | select RELOCATABLE if (PPC64 && !COMPILE_TEST) || 44x || FSL_BOOKE |
| 418 | help | 418 | help |
| 419 | Build a kernel suitable for use as a kdump capture kernel. | 419 | Build a kernel suitable for use as a kdump capture kernel. |
| 420 | The same kernel binary can be used as production kernel and dump | 420 | The same kernel binary can be used as production kernel and dump |
| @@ -1017,6 +1017,7 @@ endmenu | |||
| 1017 | if PPC64 | 1017 | if PPC64 |
| 1018 | config RELOCATABLE | 1018 | config RELOCATABLE |
| 1019 | bool "Build a relocatable kernel" | 1019 | bool "Build a relocatable kernel" |
| 1020 | depends on !COMPILE_TEST | ||
| 1020 | select NONSTATIC_KERNEL | 1021 | select NONSTATIC_KERNEL |
| 1021 | help | 1022 | help |
| 1022 | This builds a kernel image that is capable of running anywhere | 1023 | This builds a kernel image that is capable of running anywhere |
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index f8d1d6dcf7db..e61f24ed4e65 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h | |||
| @@ -19,8 +19,7 @@ | |||
| 19 | #define MMU_FTR_TYPE_40x ASM_CONST(0x00000004) | 19 | #define MMU_FTR_TYPE_40x ASM_CONST(0x00000004) |
| 20 | #define MMU_FTR_TYPE_44x ASM_CONST(0x00000008) | 20 | #define MMU_FTR_TYPE_44x ASM_CONST(0x00000008) |
| 21 | #define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010) | 21 | #define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010) |
| 22 | #define MMU_FTR_TYPE_3E ASM_CONST(0x00000020) | 22 | #define MMU_FTR_TYPE_47x ASM_CONST(0x00000020) |
| 23 | #define MMU_FTR_TYPE_47x ASM_CONST(0x00000040) | ||
| 24 | 23 | ||
| 25 | /* | 24 | /* |
| 26 | * This is individual features | 25 | * This is individual features |
| @@ -106,13 +105,6 @@ | |||
| 106 | MMU_FTR_CI_LARGE_PAGE | 105 | MMU_FTR_CI_LARGE_PAGE |
| 107 | #define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ | 106 | #define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ |
| 108 | MMU_FTR_CI_LARGE_PAGE | MMU_FTR_NO_SLBIE_B | 107 | MMU_FTR_CI_LARGE_PAGE | MMU_FTR_NO_SLBIE_B |
| 109 | #define MMU_FTRS_A2 MMU_FTR_TYPE_3E | MMU_FTR_USE_TLBILX | \ | ||
| 110 | MMU_FTR_USE_TLBIVAX_BCAST | \ | ||
| 111 | MMU_FTR_LOCK_BCAST_INVAL | \ | ||
| 112 | MMU_FTR_USE_TLBRSRV | \ | ||
| 113 | MMU_FTR_USE_PAIRED_MAS | \ | ||
| 114 | MMU_FTR_TLBIEL | \ | ||
| 115 | MMU_FTR_16M_PAGE | ||
| 116 | #ifndef __ASSEMBLY__ | 108 | #ifndef __ASSEMBLY__ |
| 117 | #include <asm/cputable.h> | 109 | #include <asm/cputable.h> |
| 118 | 110 | ||
diff --git a/arch/powerpc/include/asm/perf_event_server.h b/arch/powerpc/include/asm/perf_event_server.h index 9ed737146dbb..b3e936027b26 100644 --- a/arch/powerpc/include/asm/perf_event_server.h +++ b/arch/powerpc/include/asm/perf_event_server.h | |||
| @@ -61,8 +61,7 @@ struct power_pmu { | |||
| 61 | #define PPMU_SIAR_VALID 0x00000010 /* Processor has SIAR Valid bit */ | 61 | #define PPMU_SIAR_VALID 0x00000010 /* Processor has SIAR Valid bit */ |
| 62 | #define PPMU_HAS_SSLOT 0x00000020 /* Has sampled slot in MMCRA */ | 62 | #define PPMU_HAS_SSLOT 0x00000020 /* Has sampled slot in MMCRA */ |
| 63 | #define PPMU_HAS_SIER 0x00000040 /* Has SIER */ | 63 | #define PPMU_HAS_SIER 0x00000040 /* Has SIER */ |
| 64 | #define PPMU_BHRB 0x00000080 /* has BHRB feature enabled */ | 64 | #define PPMU_ARCH_207S 0x00000080 /* PMC is architecture v2.07S */ |
| 65 | #define PPMU_EBB 0x00000100 /* supports event based branch */ | ||
| 66 | 65 | ||
| 67 | /* | 66 | /* |
| 68 | * Values for flags to get_alternatives() | 67 | * Values for flags to get_alternatives() |
diff --git a/arch/powerpc/kernel/idle_power7.S b/arch/powerpc/kernel/idle_power7.S index 2480256272d4..5cf3d367190d 100644 --- a/arch/powerpc/kernel/idle_power7.S +++ b/arch/powerpc/kernel/idle_power7.S | |||
| @@ -131,7 +131,7 @@ _GLOBAL(power7_nap) | |||
| 131 | 131 | ||
| 132 | _GLOBAL(power7_sleep) | 132 | _GLOBAL(power7_sleep) |
| 133 | li r3,1 | 133 | li r3,1 |
| 134 | li r4,0 | 134 | li r4,1 |
| 135 | b power7_powersave_common | 135 | b power7_powersave_common |
| 136 | /* No return */ | 136 | /* No return */ |
| 137 | 137 | ||
diff --git a/arch/powerpc/kvm/book3s_hv_interrupts.S b/arch/powerpc/kvm/book3s_hv_interrupts.S index 8c86422a1e37..731be7478b27 100644 --- a/arch/powerpc/kvm/book3s_hv_interrupts.S +++ b/arch/powerpc/kvm/book3s_hv_interrupts.S | |||
| @@ -127,11 +127,6 @@ BEGIN_FTR_SECTION | |||
| 127 | stw r10, HSTATE_PMC + 24(r13) | 127 | stw r10, HSTATE_PMC + 24(r13) |
| 128 | stw r11, HSTATE_PMC + 28(r13) | 128 | stw r11, HSTATE_PMC + 28(r13) |
| 129 | END_FTR_SECTION_IFSET(CPU_FTR_ARCH_201) | 129 | END_FTR_SECTION_IFSET(CPU_FTR_ARCH_201) |
| 130 | BEGIN_FTR_SECTION | ||
| 131 | mfspr r9, SPRN_SIER | ||
| 132 | std r8, HSTATE_MMCR + 40(r13) | ||
| 133 | std r9, HSTATE_MMCR + 48(r13) | ||
| 134 | END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) | ||
| 135 | 31: | 130 | 31: |
| 136 | 131 | ||
| 137 | /* | 132 | /* |
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c index af3d78e19302..928ebe79668b 100644 --- a/arch/powerpc/mm/mmu_context_nohash.c +++ b/arch/powerpc/mm/mmu_context_nohash.c | |||
| @@ -410,17 +410,7 @@ void __init mmu_context_init(void) | |||
| 410 | } else if (mmu_has_feature(MMU_FTR_TYPE_47x)) { | 410 | } else if (mmu_has_feature(MMU_FTR_TYPE_47x)) { |
| 411 | first_context = 1; | 411 | first_context = 1; |
| 412 | last_context = 65535; | 412 | last_context = 65535; |
| 413 | } else | 413 | } else { |
| 414 | #ifdef CONFIG_PPC_BOOK3E_MMU | ||
| 415 | if (mmu_has_feature(MMU_FTR_TYPE_3E)) { | ||
| 416 | u32 mmucfg = mfspr(SPRN_MMUCFG); | ||
| 417 | u32 pid_bits = (mmucfg & MMUCFG_PIDSIZE_MASK) | ||
| 418 | >> MMUCFG_PIDSIZE_SHIFT; | ||
| 419 | first_context = 1; | ||
| 420 | last_context = (1UL << (pid_bits + 1)) - 1; | ||
| 421 | } else | ||
| 422 | #endif | ||
| 423 | { | ||
| 424 | first_context = 1; | 414 | first_context = 1; |
| 425 | last_context = 255; | 415 | last_context = 255; |
| 426 | } | 416 | } |
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c index 4520c9356b54..6b0641c3f03f 100644 --- a/arch/powerpc/perf/core-book3s.c +++ b/arch/powerpc/perf/core-book3s.c | |||
| @@ -485,7 +485,7 @@ static bool is_ebb_event(struct perf_event *event) | |||
| 485 | * check that the PMU supports EBB, meaning those that don't can still | 485 | * check that the PMU supports EBB, meaning those that don't can still |
| 486 | * use bit 63 of the event code for something else if they wish. | 486 | * use bit 63 of the event code for something else if they wish. |
| 487 | */ | 487 | */ |
| 488 | return (ppmu->flags & PPMU_EBB) && | 488 | return (ppmu->flags & PPMU_ARCH_207S) && |
| 489 | ((event->attr.config >> PERF_EVENT_CONFIG_EBB_SHIFT) & 1); | 489 | ((event->attr.config >> PERF_EVENT_CONFIG_EBB_SHIFT) & 1); |
| 490 | } | 490 | } |
| 491 | 491 | ||
| @@ -777,7 +777,7 @@ void perf_event_print_debug(void) | |||
| 777 | if (ppmu->flags & PPMU_HAS_SIER) | 777 | if (ppmu->flags & PPMU_HAS_SIER) |
| 778 | sier = mfspr(SPRN_SIER); | 778 | sier = mfspr(SPRN_SIER); |
| 779 | 779 | ||
| 780 | if (ppmu->flags & PPMU_EBB) { | 780 | if (ppmu->flags & PPMU_ARCH_207S) { |
| 781 | pr_info("MMCR2: %016lx EBBHR: %016lx\n", | 781 | pr_info("MMCR2: %016lx EBBHR: %016lx\n", |
| 782 | mfspr(SPRN_MMCR2), mfspr(SPRN_EBBHR)); | 782 | mfspr(SPRN_MMCR2), mfspr(SPRN_EBBHR)); |
| 783 | pr_info("EBBRR: %016lx BESCR: %016lx\n", | 783 | pr_info("EBBRR: %016lx BESCR: %016lx\n", |
| @@ -996,7 +996,22 @@ static void power_pmu_read(struct perf_event *event) | |||
| 996 | } while (local64_cmpxchg(&event->hw.prev_count, prev, val) != prev); | 996 | } while (local64_cmpxchg(&event->hw.prev_count, prev, val) != prev); |
| 997 | 997 | ||
| 998 | local64_add(delta, &event->count); | 998 | local64_add(delta, &event->count); |
| 999 | local64_sub(delta, &event->hw.period_left); | 999 | |
| 1000 | /* | ||
| 1001 | * A number of places program the PMC with (0x80000000 - period_left). | ||
| 1002 | * We never want period_left to be less than 1 because we will program | ||
| 1003 | * the PMC with a value >= 0x800000000 and an edge detected PMC will | ||
| 1004 | * roll around to 0 before taking an exception. We have seen this | ||
| 1005 | * on POWER8. | ||
| 1006 | * | ||
| 1007 | * To fix this, clamp the minimum value of period_left to 1. | ||
| 1008 | */ | ||
| 1009 | do { | ||
| 1010 | prev = local64_read(&event->hw.period_left); | ||
| 1011 | val = prev - delta; | ||
| 1012 | if (val < 1) | ||
| 1013 | val = 1; | ||
| 1014 | } while (local64_cmpxchg(&event->hw.period_left, prev, val) != prev); | ||
| 1000 | } | 1015 | } |
| 1001 | 1016 | ||
| 1002 | /* | 1017 | /* |
| @@ -1300,6 +1315,9 @@ static void power_pmu_enable(struct pmu *pmu) | |||
| 1300 | 1315 | ||
| 1301 | write_mmcr0(cpuhw, mmcr0); | 1316 | write_mmcr0(cpuhw, mmcr0); |
| 1302 | 1317 | ||
| 1318 | if (ppmu->flags & PPMU_ARCH_207S) | ||
| 1319 | mtspr(SPRN_MMCR2, 0); | ||
| 1320 | |||
| 1303 | /* | 1321 | /* |
| 1304 | * Enable instruction sampling if necessary | 1322 | * Enable instruction sampling if necessary |
| 1305 | */ | 1323 | */ |
| @@ -1696,7 +1714,7 @@ static int power_pmu_event_init(struct perf_event *event) | |||
| 1696 | 1714 | ||
| 1697 | if (has_branch_stack(event)) { | 1715 | if (has_branch_stack(event)) { |
| 1698 | /* PMU has BHRB enabled */ | 1716 | /* PMU has BHRB enabled */ |
| 1699 | if (!(ppmu->flags & PPMU_BHRB)) | 1717 | if (!(ppmu->flags & PPMU_ARCH_207S)) |
| 1700 | return -EOPNOTSUPP; | 1718 | return -EOPNOTSUPP; |
| 1701 | } | 1719 | } |
| 1702 | 1720 | ||
diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c index fe2763b6e039..639cd9156585 100644 --- a/arch/powerpc/perf/power8-pmu.c +++ b/arch/powerpc/perf/power8-pmu.c | |||
| @@ -792,7 +792,7 @@ static struct power_pmu power8_pmu = { | |||
| 792 | .get_constraint = power8_get_constraint, | 792 | .get_constraint = power8_get_constraint, |
| 793 | .get_alternatives = power8_get_alternatives, | 793 | .get_alternatives = power8_get_alternatives, |
| 794 | .disable_pmc = power8_disable_pmc, | 794 | .disable_pmc = power8_disable_pmc, |
| 795 | .flags = PPMU_HAS_SSLOT | PPMU_HAS_SIER | PPMU_BHRB | PPMU_EBB, | 795 | .flags = PPMU_HAS_SSLOT | PPMU_HAS_SIER | PPMU_ARCH_207S, |
| 796 | .n_generic = ARRAY_SIZE(power8_generic_events), | 796 | .n_generic = ARRAY_SIZE(power8_generic_events), |
| 797 | .generic_events = power8_generic_events, | 797 | .generic_events = power8_generic_events, |
| 798 | .cache_events = &power8_cache_events, | 798 | .cache_events = &power8_cache_events, |
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/platforms/cell/spu_syscalls.c index 38e0a1a5cec3..5e6e0bad6db6 100644 --- a/arch/powerpc/platforms/cell/spu_syscalls.c +++ b/arch/powerpc/platforms/cell/spu_syscalls.c | |||
| @@ -111,6 +111,7 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus) | |||
| 111 | return ret; | 111 | return ret; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | #ifdef CONFIG_COREDUMP | ||
| 114 | int elf_coredump_extra_notes_size(void) | 115 | int elf_coredump_extra_notes_size(void) |
| 115 | { | 116 | { |
| 116 | struct spufs_calls *calls; | 117 | struct spufs_calls *calls; |
| @@ -142,6 +143,7 @@ int elf_coredump_extra_notes_write(struct coredump_params *cprm) | |||
| 142 | 143 | ||
| 143 | return ret; | 144 | return ret; |
| 144 | } | 145 | } |
| 146 | #endif | ||
| 145 | 147 | ||
| 146 | void notify_spus_active(void) | 148 | void notify_spus_active(void) |
| 147 | { | 149 | { |
diff --git a/arch/powerpc/platforms/cell/spufs/Makefile b/arch/powerpc/platforms/cell/spufs/Makefile index b9d5d678aa44..52a7d2596d30 100644 --- a/arch/powerpc/platforms/cell/spufs/Makefile +++ b/arch/powerpc/platforms/cell/spufs/Makefile | |||
| @@ -1,8 +1,9 @@ | |||
| 1 | 1 | ||
| 2 | obj-$(CONFIG_SPU_FS) += spufs.o | 2 | obj-$(CONFIG_SPU_FS) += spufs.o |
| 3 | spufs-y += inode.o file.o context.o syscalls.o coredump.o | 3 | spufs-y += inode.o file.o context.o syscalls.o |
| 4 | spufs-y += sched.o backing_ops.o hw_ops.o run.o gang.o | 4 | spufs-y += sched.o backing_ops.o hw_ops.o run.o gang.o |
| 5 | spufs-y += switch.o fault.o lscsa_alloc.o | 5 | spufs-y += switch.o fault.o lscsa_alloc.o |
| 6 | spufs-$(CONFIG_COREDUMP) += coredump.o | ||
| 6 | 7 | ||
| 7 | # magic for the trace events | 8 | # magic for the trace events |
| 8 | CFLAGS_sched.o := -I$(src) | 9 | CFLAGS_sched.o := -I$(src) |
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c index b045fdda4845..a87200a535fa 100644 --- a/arch/powerpc/platforms/cell/spufs/syscalls.c +++ b/arch/powerpc/platforms/cell/spufs/syscalls.c | |||
| @@ -79,8 +79,10 @@ static long do_spu_create(const char __user *pathname, unsigned int flags, | |||
| 79 | struct spufs_calls spufs_calls = { | 79 | struct spufs_calls spufs_calls = { |
| 80 | .create_thread = do_spu_create, | 80 | .create_thread = do_spu_create, |
| 81 | .spu_run = do_spu_run, | 81 | .spu_run = do_spu_run, |
| 82 | .coredump_extra_notes_size = spufs_coredump_extra_notes_size, | ||
| 83 | .coredump_extra_notes_write = spufs_coredump_extra_notes_write, | ||
| 84 | .notify_spus_active = do_notify_spus_active, | 82 | .notify_spus_active = do_notify_spus_active, |
| 85 | .owner = THIS_MODULE, | 83 | .owner = THIS_MODULE, |
| 84 | #ifdef CONFIG_COREDUMP | ||
| 85 | .coredump_extra_notes_size = spufs_coredump_extra_notes_size, | ||
| 86 | .coredump_extra_notes_write = spufs_coredump_extra_notes_write, | ||
| 87 | #endif | ||
| 86 | }; | 88 | }; |
diff --git a/arch/x86/crypto/sha512_ssse3_glue.c b/arch/x86/crypto/sha512_ssse3_glue.c index f30cd10293f0..8626b03e83b7 100644 --- a/arch/x86/crypto/sha512_ssse3_glue.c +++ b/arch/x86/crypto/sha512_ssse3_glue.c | |||
| @@ -141,7 +141,7 @@ static int sha512_ssse3_final(struct shash_desc *desc, u8 *out) | |||
| 141 | 141 | ||
| 142 | /* save number of bits */ | 142 | /* save number of bits */ |
| 143 | bits[1] = cpu_to_be64(sctx->count[0] << 3); | 143 | bits[1] = cpu_to_be64(sctx->count[0] << 3); |
| 144 | bits[0] = cpu_to_be64(sctx->count[1] << 3) | sctx->count[0] >> 61; | 144 | bits[0] = cpu_to_be64(sctx->count[1] << 3 | sctx->count[0] >> 61); |
| 145 | 145 | ||
| 146 | /* Pad out to 112 mod 128 and append length */ | 146 | /* Pad out to 112 mod 128 and append length */ |
| 147 | index = sctx->count[0] & 0x7f; | 147 | index = sctx->count[0] & 0x7f; |
diff --git a/arch/x86/vdso/vdso2c.h b/arch/x86/vdso/vdso2c.h index df95a2fdff73..11b65d4f9414 100644 --- a/arch/x86/vdso/vdso2c.h +++ b/arch/x86/vdso/vdso2c.h | |||
| @@ -93,6 +93,9 @@ static void BITSFUNC(copy_section)(struct BITSFUNC(fake_sections) *out, | |||
| 93 | uint64_t flags = GET_LE(&in->sh_flags); | 93 | uint64_t flags = GET_LE(&in->sh_flags); |
| 94 | 94 | ||
| 95 | bool copy = flags & SHF_ALLOC && | 95 | bool copy = flags & SHF_ALLOC && |
| 96 | (GET_LE(&in->sh_size) || | ||
| 97 | (GET_LE(&in->sh_type) != SHT_RELA && | ||
| 98 | GET_LE(&in->sh_type) != SHT_REL)) && | ||
| 96 | strcmp(name, ".altinstructions") && | 99 | strcmp(name, ".altinstructions") && |
| 97 | strcmp(name, ".altinstr_replacement"); | 100 | strcmp(name, ".altinstr_replacement"); |
| 98 | 101 | ||
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c index e1513c47872a..5a5176de8d0a 100644 --- a/arch/x86/vdso/vma.c +++ b/arch/x86/vdso/vma.c | |||
| @@ -62,6 +62,9 @@ struct linux_binprm; | |||
| 62 | Only used for the 64-bit and x32 vdsos. */ | 62 | Only used for the 64-bit and x32 vdsos. */ |
| 63 | static unsigned long vdso_addr(unsigned long start, unsigned len) | 63 | static unsigned long vdso_addr(unsigned long start, unsigned len) |
| 64 | { | 64 | { |
| 65 | #ifdef CONFIG_X86_32 | ||
| 66 | return 0; | ||
| 67 | #else | ||
| 65 | unsigned long addr, end; | 68 | unsigned long addr, end; |
| 66 | unsigned offset; | 69 | unsigned offset; |
| 67 | end = (start + PMD_SIZE - 1) & PMD_MASK; | 70 | end = (start + PMD_SIZE - 1) & PMD_MASK; |
| @@ -83,6 +86,7 @@ static unsigned long vdso_addr(unsigned long start, unsigned len) | |||
| 83 | addr = align_vdso_addr(addr); | 86 | addr = align_vdso_addr(addr); |
| 84 | 87 | ||
| 85 | return addr; | 88 | return addr; |
| 89 | #endif | ||
| 86 | } | 90 | } |
| 87 | 91 | ||
| 88 | static int map_vdso(const struct vdso_image *image, bool calculate_addr) | 92 | static int map_vdso(const struct vdso_image *image, bool calculate_addr) |
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index c67f6f5ad611..36b0e61f9c09 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
| @@ -30,6 +30,10 @@ | |||
| 30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
| 31 | #include <linux/dmi.h> | 31 | #include <linux/dmi.h> |
| 32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
| 33 | #ifdef CONFIG_ACPI_PROCFS_POWER | ||
| 34 | #include <linux/proc_fs.h> | ||
| 35 | #include <linux/seq_file.h> | ||
| 36 | #endif | ||
| 33 | #include <linux/platform_device.h> | 37 | #include <linux/platform_device.h> |
| 34 | #include <linux/power_supply.h> | 38 | #include <linux/power_supply.h> |
| 35 | #include <linux/acpi.h> | 39 | #include <linux/acpi.h> |
| @@ -52,6 +56,7 @@ MODULE_AUTHOR("Paul Diefenbaugh"); | |||
| 52 | MODULE_DESCRIPTION("ACPI AC Adapter Driver"); | 56 | MODULE_DESCRIPTION("ACPI AC Adapter Driver"); |
| 53 | MODULE_LICENSE("GPL"); | 57 | MODULE_LICENSE("GPL"); |
| 54 | 58 | ||
| 59 | |||
| 55 | static int acpi_ac_add(struct acpi_device *device); | 60 | static int acpi_ac_add(struct acpi_device *device); |
| 56 | static int acpi_ac_remove(struct acpi_device *device); | 61 | static int acpi_ac_remove(struct acpi_device *device); |
| 57 | static void acpi_ac_notify(struct acpi_device *device, u32 event); | 62 | static void acpi_ac_notify(struct acpi_device *device, u32 event); |
| @@ -67,6 +72,13 @@ static int acpi_ac_resume(struct device *dev); | |||
| 67 | #endif | 72 | #endif |
| 68 | static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume); | 73 | static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume); |
| 69 | 74 | ||
| 75 | #ifdef CONFIG_ACPI_PROCFS_POWER | ||
| 76 | extern struct proc_dir_entry *acpi_lock_ac_dir(void); | ||
| 77 | extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir); | ||
| 78 | static int acpi_ac_open_fs(struct inode *inode, struct file *file); | ||
| 79 | #endif | ||
| 80 | |||
| 81 | |||
| 70 | static int ac_sleep_before_get_state_ms; | 82 | static int ac_sleep_before_get_state_ms; |
| 71 | 83 | ||
| 72 | static struct acpi_driver acpi_ac_driver = { | 84 | static struct acpi_driver acpi_ac_driver = { |
| @@ -91,6 +103,16 @@ struct acpi_ac { | |||
| 91 | 103 | ||
| 92 | #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger) | 104 | #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger) |
| 93 | 105 | ||
| 106 | #ifdef CONFIG_ACPI_PROCFS_POWER | ||
| 107 | static const struct file_operations acpi_ac_fops = { | ||
| 108 | .owner = THIS_MODULE, | ||
| 109 | .open = acpi_ac_open_fs, | ||
| 110 | .read = seq_read, | ||
| 111 | .llseek = seq_lseek, | ||
| 112 | .release = single_release, | ||
| 113 | }; | ||
| 114 | #endif | ||
| 115 | |||
| 94 | /* -------------------------------------------------------------------------- | 116 | /* -------------------------------------------------------------------------- |
| 95 | AC Adapter Management | 117 | AC Adapter Management |
| 96 | -------------------------------------------------------------------------- */ | 118 | -------------------------------------------------------------------------- */ |
| @@ -143,6 +165,83 @@ static enum power_supply_property ac_props[] = { | |||
| 143 | POWER_SUPPLY_PROP_ONLINE, | 165 | POWER_SUPPLY_PROP_ONLINE, |
| 144 | }; | 166 | }; |
| 145 | 167 | ||
| 168 | #ifdef CONFIG_ACPI_PROCFS_POWER | ||
| 169 | /* -------------------------------------------------------------------------- | ||
| 170 | FS Interface (/proc) | ||
| 171 | -------------------------------------------------------------------------- */ | ||
| 172 | |||
| 173 | static struct proc_dir_entry *acpi_ac_dir; | ||
| 174 | |||
| 175 | static int acpi_ac_seq_show(struct seq_file *seq, void *offset) | ||
| 176 | { | ||
| 177 | struct acpi_ac *ac = seq->private; | ||
| 178 | |||
| 179 | |||
| 180 | if (!ac) | ||
| 181 | return 0; | ||
| 182 | |||
| 183 | if (acpi_ac_get_state(ac)) { | ||
| 184 | seq_puts(seq, "ERROR: Unable to read AC Adapter state\n"); | ||
| 185 | return 0; | ||
| 186 | } | ||
| 187 | |||
| 188 | seq_puts(seq, "state: "); | ||
| 189 | switch (ac->state) { | ||
| 190 | case ACPI_AC_STATUS_OFFLINE: | ||
| 191 | seq_puts(seq, "off-line\n"); | ||
| 192 | break; | ||
| 193 | case ACPI_AC_STATUS_ONLINE: | ||
| 194 | seq_puts(seq, "on-line\n"); | ||
| 195 | break; | ||
| 196 | default: | ||
| 197 | seq_puts(seq, "unknown\n"); | ||
| 198 | break; | ||
| 199 | } | ||
| 200 | |||
| 201 | return 0; | ||
| 202 | } | ||
| 203 | |||
| 204 | static int acpi_ac_open_fs(struct inode *inode, struct file *file) | ||
| 205 | { | ||
| 206 | return single_open(file, acpi_ac_seq_show, PDE_DATA(inode)); | ||
| 207 | } | ||
| 208 | |||
| 209 | static int acpi_ac_add_fs(struct acpi_ac *ac) | ||
| 210 | { | ||
| 211 | struct proc_dir_entry *entry = NULL; | ||
| 212 | |||
| 213 | printk(KERN_WARNING PREFIX "Deprecated procfs I/F for AC is loaded," | ||
| 214 | " please retry with CONFIG_ACPI_PROCFS_POWER cleared\n"); | ||
| 215 | if (!acpi_device_dir(ac->device)) { | ||
| 216 | acpi_device_dir(ac->device) = | ||
| 217 | proc_mkdir(acpi_device_bid(ac->device), acpi_ac_dir); | ||
| 218 | if (!acpi_device_dir(ac->device)) | ||
| 219 | return -ENODEV; | ||
| 220 | } | ||
| 221 | |||
| 222 | /* 'state' [R] */ | ||
| 223 | entry = proc_create_data(ACPI_AC_FILE_STATE, | ||
| 224 | S_IRUGO, acpi_device_dir(ac->device), | ||
| 225 | &acpi_ac_fops, ac); | ||
| 226 | if (!entry) | ||
| 227 | return -ENODEV; | ||
| 228 | return 0; | ||
| 229 | } | ||
| 230 | |||
| 231 | static int acpi_ac_remove_fs(struct acpi_ac *ac) | ||
| 232 | { | ||
| 233 | |||
| 234 | if (acpi_device_dir(ac->device)) { | ||
| 235 | remove_proc_entry(ACPI_AC_FILE_STATE, | ||
| 236 | acpi_device_dir(ac->device)); | ||
| 237 | remove_proc_entry(acpi_device_bid(ac->device), acpi_ac_dir); | ||
| 238 | acpi_device_dir(ac->device) = NULL; | ||
| 239 | } | ||
| 240 | |||
| 241 | return 0; | ||
| 242 | } | ||
| 243 | #endif | ||
| 244 | |||
| 146 | /* -------------------------------------------------------------------------- | 245 | /* -------------------------------------------------------------------------- |
| 147 | Driver Model | 246 | Driver Model |
| 148 | -------------------------------------------------------------------------- */ | 247 | -------------------------------------------------------------------------- */ |
| @@ -243,6 +342,11 @@ static int acpi_ac_add(struct acpi_device *device) | |||
| 243 | goto end; | 342 | goto end; |
| 244 | 343 | ||
| 245 | ac->charger.name = acpi_device_bid(device); | 344 | ac->charger.name = acpi_device_bid(device); |
| 345 | #ifdef CONFIG_ACPI_PROCFS_POWER | ||
| 346 | result = acpi_ac_add_fs(ac); | ||
| 347 | if (result) | ||
| 348 | goto end; | ||
| 349 | #endif | ||
| 246 | ac->charger.type = POWER_SUPPLY_TYPE_MAINS; | 350 | ac->charger.type = POWER_SUPPLY_TYPE_MAINS; |
| 247 | ac->charger.properties = ac_props; | 351 | ac->charger.properties = ac_props; |
| 248 | ac->charger.num_properties = ARRAY_SIZE(ac_props); | 352 | ac->charger.num_properties = ARRAY_SIZE(ac_props); |
| @@ -258,8 +362,12 @@ static int acpi_ac_add(struct acpi_device *device) | |||
| 258 | ac->battery_nb.notifier_call = acpi_ac_battery_notify; | 362 | ac->battery_nb.notifier_call = acpi_ac_battery_notify; |
| 259 | register_acpi_notifier(&ac->battery_nb); | 363 | register_acpi_notifier(&ac->battery_nb); |
| 260 | end: | 364 | end: |
| 261 | if (result) | 365 | if (result) { |
| 366 | #ifdef CONFIG_ACPI_PROCFS_POWER | ||
| 367 | acpi_ac_remove_fs(ac); | ||
| 368 | #endif | ||
| 262 | kfree(ac); | 369 | kfree(ac); |
| 370 | } | ||
| 263 | 371 | ||
| 264 | dmi_check_system(ac_dmi_table); | 372 | dmi_check_system(ac_dmi_table); |
| 265 | return result; | 373 | return result; |
| @@ -303,6 +411,10 @@ static int acpi_ac_remove(struct acpi_device *device) | |||
| 303 | power_supply_unregister(&ac->charger); | 411 | power_supply_unregister(&ac->charger); |
| 304 | unregister_acpi_notifier(&ac->battery_nb); | 412 | unregister_acpi_notifier(&ac->battery_nb); |
| 305 | 413 | ||
| 414 | #ifdef CONFIG_ACPI_PROCFS_POWER | ||
| 415 | acpi_ac_remove_fs(ac); | ||
| 416 | #endif | ||
| 417 | |||
| 306 | kfree(ac); | 418 | kfree(ac); |
| 307 | 419 | ||
| 308 | return 0; | 420 | return 0; |
| @@ -315,9 +427,20 @@ static int __init acpi_ac_init(void) | |||
| 315 | if (acpi_disabled) | 427 | if (acpi_disabled) |
| 316 | return -ENODEV; | 428 | return -ENODEV; |
| 317 | 429 | ||
| 430 | #ifdef CONFIG_ACPI_PROCFS_POWER | ||
| 431 | acpi_ac_dir = acpi_lock_ac_dir(); | ||
| 432 | if (!acpi_ac_dir) | ||
| 433 | return -ENODEV; | ||
| 434 | #endif | ||
| 435 | |||
| 436 | |||
| 318 | result = acpi_bus_register_driver(&acpi_ac_driver); | 437 | result = acpi_bus_register_driver(&acpi_ac_driver); |
| 319 | if (result < 0) | 438 | if (result < 0) { |
| 439 | #ifdef CONFIG_ACPI_PROCFS_POWER | ||
| 440 | acpi_unlock_ac_dir(acpi_ac_dir); | ||
| 441 | #endif | ||
| 320 | return -ENODEV; | 442 | return -ENODEV; |
| 443 | } | ||
| 321 | 444 | ||
| 322 | return 0; | 445 | return 0; |
| 323 | } | 446 | } |
| @@ -325,6 +448,9 @@ static int __init acpi_ac_init(void) | |||
| 325 | static void __exit acpi_ac_exit(void) | 448 | static void __exit acpi_ac_exit(void) |
| 326 | { | 449 | { |
| 327 | acpi_bus_unregister_driver(&acpi_ac_driver); | 450 | acpi_bus_unregister_driver(&acpi_ac_driver); |
| 451 | #ifdef CONFIG_ACPI_PROCFS_POWER | ||
| 452 | acpi_unlock_ac_dir(acpi_ac_dir); | ||
| 453 | #endif | ||
| 328 | } | 454 | } |
| 329 | module_init(acpi_ac_init); | 455 | module_init(acpi_ac_init); |
| 330 | module_exit(acpi_ac_exit); | 456 | module_exit(acpi_ac_exit); |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 0d7116f34b95..130f513e08c9 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <linux/delay.h> | 35 | #include <linux/delay.h> |
| 36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
| 37 | #include <linux/suspend.h> | 37 | #include <linux/suspend.h> |
| 38 | #include <linux/delay.h> | ||
| 38 | #include <asm/unaligned.h> | 39 | #include <asm/unaligned.h> |
| 39 | 40 | ||
| 40 | #ifdef CONFIG_ACPI_PROCFS_POWER | 41 | #ifdef CONFIG_ACPI_PROCFS_POWER |
| @@ -534,6 +535,20 @@ static int acpi_battery_get_state(struct acpi_battery *battery) | |||
| 534 | " invalid.\n"); | 535 | " invalid.\n"); |
| 535 | } | 536 | } |
| 536 | 537 | ||
| 538 | /* | ||
| 539 | * When fully charged, some batteries wrongly report | ||
| 540 | * capacity_now = design_capacity instead of = full_charge_capacity | ||
| 541 | */ | ||
| 542 | if (battery->capacity_now > battery->full_charge_capacity | ||
| 543 | && battery->full_charge_capacity != ACPI_BATTERY_VALUE_UNKNOWN) { | ||
| 544 | battery->capacity_now = battery->full_charge_capacity; | ||
| 545 | if (battery->capacity_now != battery->design_capacity) | ||
| 546 | printk_once(KERN_WARNING FW_BUG | ||
| 547 | "battery: reported current charge level (%d) " | ||
| 548 | "is higher than reported maximum charge level (%d).\n", | ||
| 549 | battery->capacity_now, battery->full_charge_capacity); | ||
| 550 | } | ||
| 551 | |||
| 537 | if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags) | 552 | if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags) |
| 538 | && battery->capacity_now >= 0 && battery->capacity_now <= 100) | 553 | && battery->capacity_now >= 0 && battery->capacity_now <= 100) |
| 539 | battery->capacity_now = (battery->capacity_now * | 554 | battery->capacity_now = (battery->capacity_now * |
| @@ -1151,6 +1166,28 @@ static struct dmi_system_id bat_dmi_table[] = { | |||
| 1151 | {}, | 1166 | {}, |
| 1152 | }; | 1167 | }; |
| 1153 | 1168 | ||
| 1169 | /* | ||
| 1170 | * Some machines'(E,G Lenovo Z480) ECs are not stable | ||
| 1171 | * during boot up and this causes battery driver fails to be | ||
| 1172 | * probed due to failure of getting battery information | ||
| 1173 | * from EC sometimes. After several retries, the operation | ||
| 1174 | * may work. So add retry code here and 20ms sleep between | ||
| 1175 | * every retries. | ||
| 1176 | */ | ||
| 1177 | static int acpi_battery_update_retry(struct acpi_battery *battery) | ||
| 1178 | { | ||
| 1179 | int retry, ret; | ||
| 1180 | |||
| 1181 | for (retry = 5; retry; retry--) { | ||
| 1182 | ret = acpi_battery_update(battery, false); | ||
| 1183 | if (!ret) | ||
| 1184 | break; | ||
| 1185 | |||
| 1186 | msleep(20); | ||
| 1187 | } | ||
| 1188 | return ret; | ||
| 1189 | } | ||
| 1190 | |||
| 1154 | static int acpi_battery_add(struct acpi_device *device) | 1191 | static int acpi_battery_add(struct acpi_device *device) |
| 1155 | { | 1192 | { |
| 1156 | int result = 0; | 1193 | int result = 0; |
| @@ -1169,9 +1206,11 @@ static int acpi_battery_add(struct acpi_device *device) | |||
| 1169 | mutex_init(&battery->sysfs_lock); | 1206 | mutex_init(&battery->sysfs_lock); |
| 1170 | if (acpi_has_method(battery->device->handle, "_BIX")) | 1207 | if (acpi_has_method(battery->device->handle, "_BIX")) |
| 1171 | set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags); | 1208 | set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags); |
| 1172 | result = acpi_battery_update(battery, false); | 1209 | |
| 1210 | result = acpi_battery_update_retry(battery); | ||
| 1173 | if (result) | 1211 | if (result) |
| 1174 | goto fail; | 1212 | goto fail; |
| 1213 | |||
| 1175 | #ifdef CONFIG_ACPI_PROCFS_POWER | 1214 | #ifdef CONFIG_ACPI_PROCFS_POWER |
| 1176 | result = acpi_battery_add_fs(device); | 1215 | result = acpi_battery_add_fs(device); |
| 1177 | #endif | 1216 | #endif |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index ad11ba4a412d..a66ab658abbc 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
| @@ -1,11 +1,14 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * ec.c - ACPI Embedded Controller Driver (v2.1) | 2 | * ec.c - ACPI Embedded Controller Driver (v2.2) |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2006-2008 Alexey Starikovskiy <astarikovskiy@suse.de> | 4 | * Copyright (C) 2001-2014 Intel Corporation |
| 5 | * Copyright (C) 2006 Denis Sadykov <denis.m.sadykov@intel.com> | 5 | * Author: 2014 Lv Zheng <lv.zheng@intel.com> |
| 6 | * Copyright (C) 2004 Luming Yu <luming.yu@intel.com> | 6 | * 2006, 2007 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> |
| 7 | * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com> | 7 | * 2006 Denis Sadykov <denis.m.sadykov@intel.com> |
| 8 | * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> | 8 | * 2004 Luming Yu <luming.yu@intel.com> |
| 9 | * 2001, 2002 Andy Grover <andrew.grover@intel.com> | ||
| 10 | * 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> | ||
| 11 | * Copyright (C) 2008 Alexey Starikovskiy <astarikovskiy@suse.de> | ||
| 9 | * | 12 | * |
| 10 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 13 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 11 | * | 14 | * |
| @@ -52,6 +55,7 @@ | |||
| 52 | /* EC status register */ | 55 | /* EC status register */ |
| 53 | #define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */ | 56 | #define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */ |
| 54 | #define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */ | 57 | #define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */ |
| 58 | #define ACPI_EC_FLAG_CMD 0x08 /* Input buffer contains a command */ | ||
| 55 | #define ACPI_EC_FLAG_BURST 0x10 /* burst mode */ | 59 | #define ACPI_EC_FLAG_BURST 0x10 /* burst mode */ |
| 56 | #define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */ | 60 | #define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */ |
| 57 | 61 | ||
| @@ -78,6 +82,9 @@ enum { | |||
| 78 | EC_FLAGS_BLOCKED, /* Transactions are blocked */ | 82 | EC_FLAGS_BLOCKED, /* Transactions are blocked */ |
| 79 | }; | 83 | }; |
| 80 | 84 | ||
| 85 | #define ACPI_EC_COMMAND_POLL 0x01 /* Available for command byte */ | ||
| 86 | #define ACPI_EC_COMMAND_COMPLETE 0x02 /* Completed last byte */ | ||
| 87 | |||
| 81 | /* ec.c is compiled in acpi namespace so this shows up as acpi.ec_delay param */ | 88 | /* ec.c is compiled in acpi namespace so this shows up as acpi.ec_delay param */ |
| 82 | static unsigned int ec_delay __read_mostly = ACPI_EC_DELAY; | 89 | static unsigned int ec_delay __read_mostly = ACPI_EC_DELAY; |
| 83 | module_param(ec_delay, uint, 0644); | 90 | module_param(ec_delay, uint, 0644); |
| @@ -109,7 +116,7 @@ struct transaction { | |||
| 109 | u8 ri; | 116 | u8 ri; |
| 110 | u8 wlen; | 117 | u8 wlen; |
| 111 | u8 rlen; | 118 | u8 rlen; |
| 112 | bool done; | 119 | u8 flags; |
| 113 | }; | 120 | }; |
| 114 | 121 | ||
| 115 | struct acpi_ec *boot_ec, *first_ec; | 122 | struct acpi_ec *boot_ec, *first_ec; |
| @@ -127,83 +134,104 @@ static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */ | |||
| 127 | static inline u8 acpi_ec_read_status(struct acpi_ec *ec) | 134 | static inline u8 acpi_ec_read_status(struct acpi_ec *ec) |
| 128 | { | 135 | { |
| 129 | u8 x = inb(ec->command_addr); | 136 | u8 x = inb(ec->command_addr); |
| 130 | pr_debug("---> status = 0x%2.2x\n", x); | 137 | pr_debug("EC_SC(R) = 0x%2.2x " |
| 138 | "SCI_EVT=%d BURST=%d CMD=%d IBF=%d OBF=%d\n", | ||
| 139 | x, | ||
| 140 | !!(x & ACPI_EC_FLAG_SCI), | ||
| 141 | !!(x & ACPI_EC_FLAG_BURST), | ||
| 142 | !!(x & ACPI_EC_FLAG_CMD), | ||
| 143 | !!(x & ACPI_EC_FLAG_IBF), | ||
| 144 | !!(x & ACPI_EC_FLAG_OBF)); | ||
| 131 | return x; | 145 | return x; |
| 132 | } | 146 | } |
| 133 | 147 | ||
| 134 | static inline u8 acpi_ec_read_data(struct acpi_ec *ec) | 148 | static inline u8 acpi_ec_read_data(struct acpi_ec *ec) |
| 135 | { | 149 | { |
| 136 | u8 x = inb(ec->data_addr); | 150 | u8 x = inb(ec->data_addr); |
| 137 | pr_debug("---> data = 0x%2.2x\n", x); | 151 | pr_debug("EC_DATA(R) = 0x%2.2x\n", x); |
| 138 | return x; | 152 | return x; |
| 139 | } | 153 | } |
| 140 | 154 | ||
| 141 | static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command) | 155 | static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command) |
| 142 | { | 156 | { |
| 143 | pr_debug("<--- command = 0x%2.2x\n", command); | 157 | pr_debug("EC_SC(W) = 0x%2.2x\n", command); |
| 144 | outb(command, ec->command_addr); | 158 | outb(command, ec->command_addr); |
| 145 | } | 159 | } |
| 146 | 160 | ||
| 147 | static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data) | 161 | static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data) |
| 148 | { | 162 | { |
| 149 | pr_debug("<--- data = 0x%2.2x\n", data); | 163 | pr_debug("EC_DATA(W) = 0x%2.2x\n", data); |
| 150 | outb(data, ec->data_addr); | 164 | outb(data, ec->data_addr); |
| 151 | } | 165 | } |
| 152 | 166 | ||
| 153 | static int ec_transaction_done(struct acpi_ec *ec) | 167 | static int ec_transaction_completed(struct acpi_ec *ec) |
| 154 | { | 168 | { |
| 155 | unsigned long flags; | 169 | unsigned long flags; |
| 156 | int ret = 0; | 170 | int ret = 0; |
| 157 | spin_lock_irqsave(&ec->lock, flags); | 171 | spin_lock_irqsave(&ec->lock, flags); |
| 158 | if (!ec->curr || ec->curr->done) | 172 | if (ec->curr && (ec->curr->flags & ACPI_EC_COMMAND_COMPLETE)) |
| 159 | ret = 1; | 173 | ret = 1; |
| 160 | spin_unlock_irqrestore(&ec->lock, flags); | 174 | spin_unlock_irqrestore(&ec->lock, flags); |
| 161 | return ret; | 175 | return ret; |
| 162 | } | 176 | } |
| 163 | 177 | ||
| 164 | static void start_transaction(struct acpi_ec *ec) | 178 | static bool advance_transaction(struct acpi_ec *ec) |
| 165 | { | 179 | { |
| 166 | ec->curr->irq_count = ec->curr->wi = ec->curr->ri = 0; | ||
| 167 | ec->curr->done = false; | ||
| 168 | acpi_ec_write_cmd(ec, ec->curr->command); | ||
| 169 | } | ||
| 170 | |||
| 171 | static void advance_transaction(struct acpi_ec *ec, u8 status) | ||
| 172 | { | ||
| 173 | unsigned long flags; | ||
| 174 | struct transaction *t; | 180 | struct transaction *t; |
| 181 | u8 status; | ||
| 182 | bool wakeup = false; | ||
| 175 | 183 | ||
| 176 | spin_lock_irqsave(&ec->lock, flags); | 184 | pr_debug("===== %s =====\n", in_interrupt() ? "IRQ" : "TASK"); |
| 185 | status = acpi_ec_read_status(ec); | ||
| 177 | t = ec->curr; | 186 | t = ec->curr; |
| 178 | if (!t) | 187 | if (!t) |
| 179 | goto unlock; | 188 | goto err; |
| 180 | if (t->wlen > t->wi) { | 189 | if (t->flags & ACPI_EC_COMMAND_POLL) { |
| 181 | if ((status & ACPI_EC_FLAG_IBF) == 0) | 190 | if (t->wlen > t->wi) { |
| 182 | acpi_ec_write_data(ec, | 191 | if ((status & ACPI_EC_FLAG_IBF) == 0) |
| 183 | t->wdata[t->wi++]); | 192 | acpi_ec_write_data(ec, t->wdata[t->wi++]); |
| 184 | else | 193 | else |
| 185 | goto err; | 194 | goto err; |
| 186 | } else if (t->rlen > t->ri) { | 195 | } else if (t->rlen > t->ri) { |
| 187 | if ((status & ACPI_EC_FLAG_OBF) == 1) { | 196 | if ((status & ACPI_EC_FLAG_OBF) == 1) { |
| 188 | t->rdata[t->ri++] = acpi_ec_read_data(ec); | 197 | t->rdata[t->ri++] = acpi_ec_read_data(ec); |
| 189 | if (t->rlen == t->ri) | 198 | if (t->rlen == t->ri) { |
| 190 | t->done = true; | 199 | t->flags |= ACPI_EC_COMMAND_COMPLETE; |
| 200 | wakeup = true; | ||
| 201 | } | ||
| 202 | } else | ||
| 203 | goto err; | ||
| 204 | } else if (t->wlen == t->wi && | ||
| 205 | (status & ACPI_EC_FLAG_IBF) == 0) { | ||
| 206 | t->flags |= ACPI_EC_COMMAND_COMPLETE; | ||
| 207 | wakeup = true; | ||
| 208 | } | ||
| 209 | return wakeup; | ||
| 210 | } else { | ||
| 211 | if ((status & ACPI_EC_FLAG_IBF) == 0) { | ||
| 212 | acpi_ec_write_cmd(ec, t->command); | ||
| 213 | t->flags |= ACPI_EC_COMMAND_POLL; | ||
| 191 | } else | 214 | } else |
| 192 | goto err; | 215 | goto err; |
| 193 | } else if (t->wlen == t->wi && | 216 | return wakeup; |
| 194 | (status & ACPI_EC_FLAG_IBF) == 0) | 217 | } |
| 195 | t->done = true; | ||
| 196 | goto unlock; | ||
| 197 | err: | 218 | err: |
| 198 | /* | 219 | /* |
| 199 | * If SCI bit is set, then don't think it's a false IRQ | 220 | * If SCI bit is set, then don't think it's a false IRQ |
| 200 | * otherwise will take a not handled IRQ as a false one. | 221 | * otherwise will take a not handled IRQ as a false one. |
| 201 | */ | 222 | */ |
| 202 | if (in_interrupt() && !(status & ACPI_EC_FLAG_SCI)) | 223 | if (!(status & ACPI_EC_FLAG_SCI)) { |
| 203 | ++t->irq_count; | 224 | if (in_interrupt() && t) |
| 225 | ++t->irq_count; | ||
| 226 | } | ||
| 227 | return wakeup; | ||
| 228 | } | ||
| 204 | 229 | ||
| 205 | unlock: | 230 | static void start_transaction(struct acpi_ec *ec) |
| 206 | spin_unlock_irqrestore(&ec->lock, flags); | 231 | { |
| 232 | ec->curr->irq_count = ec->curr->wi = ec->curr->ri = 0; | ||
| 233 | ec->curr->flags = 0; | ||
| 234 | (void)advance_transaction(ec); | ||
| 207 | } | 235 | } |
| 208 | 236 | ||
| 209 | static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data); | 237 | static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data); |
| @@ -228,15 +256,17 @@ static int ec_poll(struct acpi_ec *ec) | |||
| 228 | /* don't sleep with disabled interrupts */ | 256 | /* don't sleep with disabled interrupts */ |
| 229 | if (EC_FLAGS_MSI || irqs_disabled()) { | 257 | if (EC_FLAGS_MSI || irqs_disabled()) { |
| 230 | udelay(ACPI_EC_MSI_UDELAY); | 258 | udelay(ACPI_EC_MSI_UDELAY); |
| 231 | if (ec_transaction_done(ec)) | 259 | if (ec_transaction_completed(ec)) |
| 232 | return 0; | 260 | return 0; |
| 233 | } else { | 261 | } else { |
| 234 | if (wait_event_timeout(ec->wait, | 262 | if (wait_event_timeout(ec->wait, |
| 235 | ec_transaction_done(ec), | 263 | ec_transaction_completed(ec), |
| 236 | msecs_to_jiffies(1))) | 264 | msecs_to_jiffies(1))) |
| 237 | return 0; | 265 | return 0; |
| 238 | } | 266 | } |
| 239 | advance_transaction(ec, acpi_ec_read_status(ec)); | 267 | spin_lock_irqsave(&ec->lock, flags); |
| 268 | (void)advance_transaction(ec); | ||
| 269 | spin_unlock_irqrestore(&ec->lock, flags); | ||
| 240 | } while (time_before(jiffies, delay)); | 270 | } while (time_before(jiffies, delay)); |
| 241 | pr_debug("controller reset, restart transaction\n"); | 271 | pr_debug("controller reset, restart transaction\n"); |
| 242 | spin_lock_irqsave(&ec->lock, flags); | 272 | spin_lock_irqsave(&ec->lock, flags); |
| @@ -268,23 +298,6 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, | |||
| 268 | return ret; | 298 | return ret; |
| 269 | } | 299 | } |
| 270 | 300 | ||
| 271 | static int ec_check_ibf0(struct acpi_ec *ec) | ||
| 272 | { | ||
| 273 | u8 status = acpi_ec_read_status(ec); | ||
| 274 | return (status & ACPI_EC_FLAG_IBF) == 0; | ||
| 275 | } | ||
| 276 | |||
| 277 | static int ec_wait_ibf0(struct acpi_ec *ec) | ||
| 278 | { | ||
| 279 | unsigned long delay = jiffies + msecs_to_jiffies(ec_delay); | ||
| 280 | /* interrupt wait manually if GPE mode is not active */ | ||
| 281 | while (time_before(jiffies, delay)) | ||
| 282 | if (wait_event_timeout(ec->wait, ec_check_ibf0(ec), | ||
| 283 | msecs_to_jiffies(1))) | ||
| 284 | return 0; | ||
| 285 | return -ETIME; | ||
| 286 | } | ||
| 287 | |||
| 288 | static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t) | 301 | static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t) |
| 289 | { | 302 | { |
| 290 | int status; | 303 | int status; |
| @@ -305,12 +318,6 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t) | |||
| 305 | goto unlock; | 318 | goto unlock; |
| 306 | } | 319 | } |
| 307 | } | 320 | } |
| 308 | if (ec_wait_ibf0(ec)) { | ||
| 309 | pr_err("input buffer is not empty, " | ||
| 310 | "aborting transaction\n"); | ||
| 311 | status = -ETIME; | ||
| 312 | goto end; | ||
| 313 | } | ||
| 314 | pr_debug("transaction start (cmd=0x%02x, addr=0x%02x)\n", | 321 | pr_debug("transaction start (cmd=0x%02x, addr=0x%02x)\n", |
| 315 | t->command, t->wdata ? t->wdata[0] : 0); | 322 | t->command, t->wdata ? t->wdata[0] : 0); |
| 316 | /* disable GPE during transaction if storm is detected */ | 323 | /* disable GPE during transaction if storm is detected */ |
| @@ -334,7 +341,6 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t) | |||
| 334 | set_bit(EC_FLAGS_GPE_STORM, &ec->flags); | 341 | set_bit(EC_FLAGS_GPE_STORM, &ec->flags); |
| 335 | } | 342 | } |
| 336 | pr_debug("transaction end\n"); | 343 | pr_debug("transaction end\n"); |
| 337 | end: | ||
| 338 | if (ec->global_lock) | 344 | if (ec->global_lock) |
| 339 | acpi_release_global_lock(glk); | 345 | acpi_release_global_lock(glk); |
| 340 | unlock: | 346 | unlock: |
| @@ -634,17 +640,14 @@ static int ec_check_sci(struct acpi_ec *ec, u8 state) | |||
| 634 | static u32 acpi_ec_gpe_handler(acpi_handle gpe_device, | 640 | static u32 acpi_ec_gpe_handler(acpi_handle gpe_device, |
| 635 | u32 gpe_number, void *data) | 641 | u32 gpe_number, void *data) |
| 636 | { | 642 | { |
| 643 | unsigned long flags; | ||
| 637 | struct acpi_ec *ec = data; | 644 | struct acpi_ec *ec = data; |
| 638 | u8 status = acpi_ec_read_status(ec); | ||
| 639 | 645 | ||
| 640 | pr_debug("~~~> interrupt, status:0x%02x\n", status); | 646 | spin_lock_irqsave(&ec->lock, flags); |
| 641 | 647 | if (advance_transaction(ec)) | |
| 642 | advance_transaction(ec, status); | ||
| 643 | if (ec_transaction_done(ec) && | ||
| 644 | (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) == 0) { | ||
| 645 | wake_up(&ec->wait); | 648 | wake_up(&ec->wait); |
| 646 | ec_check_sci(ec, acpi_ec_read_status(ec)); | 649 | spin_unlock_irqrestore(&ec->lock, flags); |
| 647 | } | 650 | ec_check_sci(ec, acpi_ec_read_status(ec)); |
| 648 | return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE; | 651 | return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE; |
| 649 | } | 652 | } |
| 650 | 653 | ||
| @@ -1066,8 +1069,10 @@ int __init acpi_ec_ecdt_probe(void) | |||
| 1066 | /* fall through */ | 1069 | /* fall through */ |
| 1067 | } | 1070 | } |
| 1068 | 1071 | ||
| 1069 | if (EC_FLAGS_SKIP_DSDT_SCAN) | 1072 | if (EC_FLAGS_SKIP_DSDT_SCAN) { |
| 1073 | kfree(saved_ec); | ||
| 1070 | return -ENODEV; | 1074 | return -ENODEV; |
| 1075 | } | ||
| 1071 | 1076 | ||
| 1072 | /* This workaround is needed only on some broken machines, | 1077 | /* This workaround is needed only on some broken machines, |
| 1073 | * which require early EC, but fail to provide ECDT */ | 1078 | * which require early EC, but fail to provide ECDT */ |
| @@ -1105,6 +1110,7 @@ install: | |||
| 1105 | } | 1110 | } |
| 1106 | error: | 1111 | error: |
| 1107 | kfree(boot_ec); | 1112 | kfree(boot_ec); |
| 1113 | kfree(saved_ec); | ||
| 1108 | boot_ec = NULL; | 1114 | boot_ec = NULL; |
| 1109 | return -ENODEV; | 1115 | return -ENODEV; |
| 1110 | } | 1116 | } |
diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index 0bdacc5e26a3..2ba8f02ced36 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c | |||
| @@ -77,7 +77,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res) | |||
| 77 | switch (ares->type) { | 77 | switch (ares->type) { |
| 78 | case ACPI_RESOURCE_TYPE_MEMORY24: | 78 | case ACPI_RESOURCE_TYPE_MEMORY24: |
| 79 | memory24 = &ares->data.memory24; | 79 | memory24 = &ares->data.memory24; |
| 80 | if (!memory24->address_length) | 80 | if (!memory24->minimum && !memory24->address_length) |
| 81 | return false; | 81 | return false; |
| 82 | acpi_dev_get_memresource(res, memory24->minimum, | 82 | acpi_dev_get_memresource(res, memory24->minimum, |
| 83 | memory24->address_length, | 83 | memory24->address_length, |
| @@ -85,7 +85,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res) | |||
| 85 | break; | 85 | break; |
| 86 | case ACPI_RESOURCE_TYPE_MEMORY32: | 86 | case ACPI_RESOURCE_TYPE_MEMORY32: |
| 87 | memory32 = &ares->data.memory32; | 87 | memory32 = &ares->data.memory32; |
| 88 | if (!memory32->address_length) | 88 | if (!memory32->minimum && !memory32->address_length) |
| 89 | return false; | 89 | return false; |
| 90 | acpi_dev_get_memresource(res, memory32->minimum, | 90 | acpi_dev_get_memresource(res, memory32->minimum, |
| 91 | memory32->address_length, | 91 | memory32->address_length, |
| @@ -93,7 +93,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res) | |||
| 93 | break; | 93 | break; |
| 94 | case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: | 94 | case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: |
| 95 | fixed_memory32 = &ares->data.fixed_memory32; | 95 | fixed_memory32 = &ares->data.fixed_memory32; |
| 96 | if (!fixed_memory32->address_length) | 96 | if (!fixed_memory32->address && !fixed_memory32->address_length) |
| 97 | return false; | 97 | return false; |
| 98 | acpi_dev_get_memresource(res, fixed_memory32->address, | 98 | acpi_dev_get_memresource(res, fixed_memory32->address, |
| 99 | fixed_memory32->address_length, | 99 | fixed_memory32->address_length, |
| @@ -150,7 +150,7 @@ bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res) | |||
| 150 | switch (ares->type) { | 150 | switch (ares->type) { |
| 151 | case ACPI_RESOURCE_TYPE_IO: | 151 | case ACPI_RESOURCE_TYPE_IO: |
| 152 | io = &ares->data.io; | 152 | io = &ares->data.io; |
| 153 | if (!io->address_length) | 153 | if (!io->minimum && !io->address_length) |
| 154 | return false; | 154 | return false; |
| 155 | acpi_dev_get_ioresource(res, io->minimum, | 155 | acpi_dev_get_ioresource(res, io->minimum, |
| 156 | io->address_length, | 156 | io->address_length, |
| @@ -158,7 +158,7 @@ bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res) | |||
| 158 | break; | 158 | break; |
| 159 | case ACPI_RESOURCE_TYPE_FIXED_IO: | 159 | case ACPI_RESOURCE_TYPE_FIXED_IO: |
| 160 | fixed_io = &ares->data.fixed_io; | 160 | fixed_io = &ares->data.fixed_io; |
| 161 | if (!fixed_io->address_length) | 161 | if (!fixed_io->address && !fixed_io->address_length) |
| 162 | return false; | 162 | return false; |
| 163 | acpi_dev_get_ioresource(res, fixed_io->address, | 163 | acpi_dev_get_ioresource(res, fixed_io->address, |
| 164 | fixed_io->address_length, | 164 | fixed_io->address_length, |
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index fb9ffe9adc64..350d52a8f781 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
| @@ -68,7 +68,7 @@ MODULE_AUTHOR("Bruno Ducrot"); | |||
| 68 | MODULE_DESCRIPTION("ACPI Video Driver"); | 68 | MODULE_DESCRIPTION("ACPI Video Driver"); |
| 69 | MODULE_LICENSE("GPL"); | 69 | MODULE_LICENSE("GPL"); |
| 70 | 70 | ||
| 71 | static bool brightness_switch_enabled; | 71 | static bool brightness_switch_enabled = 1; |
| 72 | module_param(brightness_switch_enabled, bool, 0644); | 72 | module_param(brightness_switch_enabled, bool, 0644); |
| 73 | 73 | ||
| 74 | /* | 74 | /* |
| @@ -241,13 +241,14 @@ static bool acpi_video_use_native_backlight(void) | |||
| 241 | return use_native_backlight_dmi; | 241 | return use_native_backlight_dmi; |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | static bool acpi_video_verify_backlight_support(void) | 244 | bool acpi_video_verify_backlight_support(void) |
| 245 | { | 245 | { |
| 246 | if (acpi_osi_is_win8() && acpi_video_use_native_backlight() && | 246 | if (acpi_osi_is_win8() && acpi_video_use_native_backlight() && |
| 247 | backlight_device_registered(BACKLIGHT_RAW)) | 247 | backlight_device_registered(BACKLIGHT_RAW)) |
| 248 | return false; | 248 | return false; |
| 249 | return acpi_video_backlight_support(); | 249 | return acpi_video_backlight_support(); |
| 250 | } | 250 | } |
| 251 | EXPORT_SYMBOL_GPL(acpi_video_verify_backlight_support); | ||
| 251 | 252 | ||
| 252 | /* backlight device sysfs support */ | 253 | /* backlight device sysfs support */ |
| 253 | static int acpi_video_get_brightness(struct backlight_device *bd) | 254 | static int acpi_video_get_brightness(struct backlight_device *bd) |
| @@ -563,6 +564,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = { | |||
| 563 | }, | 564 | }, |
| 564 | }, | 565 | }, |
| 565 | { | 566 | { |
| 567 | .callback = video_set_use_native_backlight, | ||
| 568 | .ident = "Acer TravelMate B113", | ||
| 569 | .matches = { | ||
| 570 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
| 571 | DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate B113"), | ||
| 572 | }, | ||
| 573 | }, | ||
| 574 | { | ||
| 566 | .callback = video_set_use_native_backlight, | 575 | .callback = video_set_use_native_backlight, |
| 567 | .ident = "HP ProBook 4340s", | 576 | .ident = "HP ProBook 4340s", |
| 568 | .matches = { | 577 | .matches = { |
| @@ -572,6 +581,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = { | |||
| 572 | }, | 581 | }, |
| 573 | { | 582 | { |
| 574 | .callback = video_set_use_native_backlight, | 583 | .callback = video_set_use_native_backlight, |
| 584 | .ident = "HP ProBook 4540s", | ||
| 585 | .matches = { | ||
| 586 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 587 | DMI_MATCH(DMI_PRODUCT_VERSION, "HP ProBook 4540s"), | ||
| 588 | }, | ||
| 589 | }, | ||
| 590 | { | ||
| 591 | .callback = video_set_use_native_backlight, | ||
| 575 | .ident = "HP ProBook 2013 models", | 592 | .ident = "HP ProBook 2013 models", |
| 576 | .matches = { | 593 | .matches = { |
| 577 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | 594 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), |
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 33e3db548a29..c42feb2bacd0 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c | |||
| @@ -166,6 +166,14 @@ static struct dmi_system_id video_detect_dmi_table[] = { | |||
| 166 | DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"), | 166 | DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"), |
| 167 | }, | 167 | }, |
| 168 | }, | 168 | }, |
| 169 | { | ||
| 170 | .callback = video_detect_force_vendor, | ||
| 171 | .ident = "Dell Inspiron 5737", | ||
| 172 | .matches = { | ||
| 173 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
| 174 | DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 5737"), | ||
| 175 | }, | ||
| 176 | }, | ||
| 169 | { }, | 177 | { }, |
| 170 | }; | 178 | }; |
| 171 | 179 | ||
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 05882e4445a6..5513296e5e2e 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h | |||
| @@ -371,7 +371,9 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, | |||
| 371 | int pmp, unsigned long deadline, | 371 | int pmp, unsigned long deadline, |
| 372 | int (*check_ready)(struct ata_link *link)); | 372 | int (*check_ready)(struct ata_link *link)); |
| 373 | 373 | ||
| 374 | unsigned int ahci_qc_issue(struct ata_queued_cmd *qc); | ||
| 374 | int ahci_stop_engine(struct ata_port *ap); | 375 | int ahci_stop_engine(struct ata_port *ap); |
| 376 | void ahci_start_fis_rx(struct ata_port *ap); | ||
| 375 | void ahci_start_engine(struct ata_port *ap); | 377 | void ahci_start_engine(struct ata_port *ap); |
| 376 | int ahci_check_ready(struct ata_link *link); | 378 | int ahci_check_ready(struct ata_link *link); |
| 377 | int ahci_kick_engine(struct ata_port *ap); | 379 | int ahci_kick_engine(struct ata_port *ap); |
diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c index 3a901520c62b..cac4360f272a 100644 --- a/drivers/ata/ahci_imx.c +++ b/drivers/ata/ahci_imx.c | |||
| @@ -58,6 +58,8 @@ enum ahci_imx_type { | |||
| 58 | struct imx_ahci_priv { | 58 | struct imx_ahci_priv { |
| 59 | struct platform_device *ahci_pdev; | 59 | struct platform_device *ahci_pdev; |
| 60 | enum ahci_imx_type type; | 60 | enum ahci_imx_type type; |
| 61 | struct clk *sata_clk; | ||
| 62 | struct clk *sata_ref_clk; | ||
| 61 | struct clk *ahb_clk; | 63 | struct clk *ahb_clk; |
| 62 | struct regmap *gpr; | 64 | struct regmap *gpr; |
| 63 | bool no_device; | 65 | bool no_device; |
| @@ -224,7 +226,7 @@ static int imx_sata_enable(struct ahci_host_priv *hpriv) | |||
| 224 | return ret; | 226 | return ret; |
| 225 | } | 227 | } |
| 226 | 228 | ||
| 227 | ret = ahci_platform_enable_clks(hpriv); | 229 | ret = clk_prepare_enable(imxpriv->sata_ref_clk); |
| 228 | if (ret < 0) | 230 | if (ret < 0) |
| 229 | goto disable_regulator; | 231 | goto disable_regulator; |
| 230 | 232 | ||
| @@ -291,7 +293,7 @@ static void imx_sata_disable(struct ahci_host_priv *hpriv) | |||
| 291 | !IMX6Q_GPR13_SATA_MPLL_CLK_EN); | 293 | !IMX6Q_GPR13_SATA_MPLL_CLK_EN); |
| 292 | } | 294 | } |
| 293 | 295 | ||
| 294 | ahci_platform_disable_clks(hpriv); | 296 | clk_disable_unprepare(imxpriv->sata_ref_clk); |
| 295 | 297 | ||
| 296 | if (hpriv->target_pwr) | 298 | if (hpriv->target_pwr) |
| 297 | regulator_disable(hpriv->target_pwr); | 299 | regulator_disable(hpriv->target_pwr); |
| @@ -324,6 +326,9 @@ static void ahci_imx_error_handler(struct ata_port *ap) | |||
| 324 | writel(reg_val | IMX_P0PHYCR_TEST_PDDQ, mmio + IMX_P0PHYCR); | 326 | writel(reg_val | IMX_P0PHYCR_TEST_PDDQ, mmio + IMX_P0PHYCR); |
| 325 | imx_sata_disable(hpriv); | 327 | imx_sata_disable(hpriv); |
| 326 | imxpriv->no_device = true; | 328 | imxpriv->no_device = true; |
| 329 | |||
| 330 | dev_info(ap->dev, "no device found, disabling link.\n"); | ||
| 331 | dev_info(ap->dev, "pass " MODULE_PARAM_PREFIX ".hotplug=1 to enable hotplug\n"); | ||
| 327 | } | 332 | } |
| 328 | 333 | ||
| 329 | static int ahci_imx_softreset(struct ata_link *link, unsigned int *class, | 334 | static int ahci_imx_softreset(struct ata_link *link, unsigned int *class, |
| @@ -385,6 +390,19 @@ static int imx_ahci_probe(struct platform_device *pdev) | |||
| 385 | imxpriv->no_device = false; | 390 | imxpriv->no_device = false; |
| 386 | imxpriv->first_time = true; | 391 | imxpriv->first_time = true; |
| 387 | imxpriv->type = (enum ahci_imx_type)of_id->data; | 392 | imxpriv->type = (enum ahci_imx_type)of_id->data; |
| 393 | |||
| 394 | imxpriv->sata_clk = devm_clk_get(dev, "sata"); | ||
| 395 | if (IS_ERR(imxpriv->sata_clk)) { | ||
| 396 | dev_err(dev, "can't get sata clock.\n"); | ||
| 397 | return PTR_ERR(imxpriv->sata_clk); | ||
| 398 | } | ||
| 399 | |||
| 400 | imxpriv->sata_ref_clk = devm_clk_get(dev, "sata_ref"); | ||
| 401 | if (IS_ERR(imxpriv->sata_ref_clk)) { | ||
| 402 | dev_err(dev, "can't get sata_ref clock.\n"); | ||
| 403 | return PTR_ERR(imxpriv->sata_ref_clk); | ||
| 404 | } | ||
| 405 | |||
| 388 | imxpriv->ahb_clk = devm_clk_get(dev, "ahb"); | 406 | imxpriv->ahb_clk = devm_clk_get(dev, "ahb"); |
| 389 | if (IS_ERR(imxpriv->ahb_clk)) { | 407 | if (IS_ERR(imxpriv->ahb_clk)) { |
| 390 | dev_err(dev, "can't get ahb clock.\n"); | 408 | dev_err(dev, "can't get ahb clock.\n"); |
| @@ -407,10 +425,14 @@ static int imx_ahci_probe(struct platform_device *pdev) | |||
| 407 | 425 | ||
| 408 | hpriv->plat_data = imxpriv; | 426 | hpriv->plat_data = imxpriv; |
| 409 | 427 | ||
| 410 | ret = imx_sata_enable(hpriv); | 428 | ret = clk_prepare_enable(imxpriv->sata_clk); |
| 411 | if (ret) | 429 | if (ret) |
| 412 | return ret; | 430 | return ret; |
| 413 | 431 | ||
| 432 | ret = imx_sata_enable(hpriv); | ||
| 433 | if (ret) | ||
| 434 | goto disable_clk; | ||
| 435 | |||
| 414 | /* | 436 | /* |
| 415 | * Configure the HWINIT bits of the HOST_CAP and HOST_PORTS_IMPL, | 437 | * Configure the HWINIT bits of the HOST_CAP and HOST_PORTS_IMPL, |
| 416 | * and IP vendor specific register IMX_TIMER1MS. | 438 | * and IP vendor specific register IMX_TIMER1MS. |
| @@ -435,16 +457,24 @@ static int imx_ahci_probe(struct platform_device *pdev) | |||
| 435 | ret = ahci_platform_init_host(pdev, hpriv, &ahci_imx_port_info, | 457 | ret = ahci_platform_init_host(pdev, hpriv, &ahci_imx_port_info, |
| 436 | 0, 0, 0); | 458 | 0, 0, 0); |
| 437 | if (ret) | 459 | if (ret) |
| 438 | imx_sata_disable(hpriv); | 460 | goto disable_sata; |
| 439 | 461 | ||
| 462 | return 0; | ||
| 463 | |||
| 464 | disable_sata: | ||
| 465 | imx_sata_disable(hpriv); | ||
| 466 | disable_clk: | ||
| 467 | clk_disable_unprepare(imxpriv->sata_clk); | ||
| 440 | return ret; | 468 | return ret; |
| 441 | } | 469 | } |
| 442 | 470 | ||
| 443 | static void ahci_imx_host_stop(struct ata_host *host) | 471 | static void ahci_imx_host_stop(struct ata_host *host) |
| 444 | { | 472 | { |
| 445 | struct ahci_host_priv *hpriv = host->private_data; | 473 | struct ahci_host_priv *hpriv = host->private_data; |
| 474 | struct imx_ahci_priv *imxpriv = hpriv->plat_data; | ||
| 446 | 475 | ||
| 447 | imx_sata_disable(hpriv); | 476 | imx_sata_disable(hpriv); |
| 477 | clk_disable_unprepare(imxpriv->sata_clk); | ||
| 448 | } | 478 | } |
| 449 | 479 | ||
| 450 | #ifdef CONFIG_PM_SLEEP | 480 | #ifdef CONFIG_PM_SLEEP |
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index ebe505c17763..b10d81ddb528 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c | |||
| @@ -58,7 +58,7 @@ static int ahci_probe(struct platform_device *pdev) | |||
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci")) | 60 | if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci")) |
| 61 | hflags |= AHCI_HFLAG_NO_FBS; | 61 | hflags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ; |
| 62 | 62 | ||
| 63 | rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info, | 63 | rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info, |
| 64 | hflags, 0, 0); | 64 | hflags, 0, 0); |
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c index 042a9bb45c86..ee3a3659bd9e 100644 --- a/drivers/ata/ahci_xgene.c +++ b/drivers/ata/ahci_xgene.c | |||
| @@ -78,6 +78,7 @@ | |||
| 78 | struct xgene_ahci_context { | 78 | struct xgene_ahci_context { |
| 79 | struct ahci_host_priv *hpriv; | 79 | struct ahci_host_priv *hpriv; |
| 80 | struct device *dev; | 80 | struct device *dev; |
| 81 | u8 last_cmd[MAX_AHCI_CHN_PERCTR]; /* tracking the last command issued*/ | ||
| 81 | void __iomem *csr_core; /* Core CSR address of IP */ | 82 | void __iomem *csr_core; /* Core CSR address of IP */ |
| 82 | void __iomem *csr_diag; /* Diag CSR address of IP */ | 83 | void __iomem *csr_diag; /* Diag CSR address of IP */ |
| 83 | void __iomem *csr_axi; /* AXI CSR address of IP */ | 84 | void __iomem *csr_axi; /* AXI CSR address of IP */ |
| @@ -98,20 +99,62 @@ static int xgene_ahci_init_memram(struct xgene_ahci_context *ctx) | |||
| 98 | } | 99 | } |
| 99 | 100 | ||
| 100 | /** | 101 | /** |
| 102 | * xgene_ahci_restart_engine - Restart the dma engine. | ||
| 103 | * @ap : ATA port of interest | ||
| 104 | * | ||
| 105 | * Restarts the dma engine inside the controller. | ||
| 106 | */ | ||
| 107 | static int xgene_ahci_restart_engine(struct ata_port *ap) | ||
| 108 | { | ||
| 109 | struct ahci_host_priv *hpriv = ap->host->private_data; | ||
| 110 | |||
| 111 | ahci_stop_engine(ap); | ||
| 112 | ahci_start_fis_rx(ap); | ||
| 113 | hpriv->start_engine(ap); | ||
| 114 | |||
| 115 | return 0; | ||
| 116 | } | ||
| 117 | |||
| 118 | /** | ||
| 119 | * xgene_ahci_qc_issue - Issue commands to the device | ||
| 120 | * @qc: Command to issue | ||
| 121 | * | ||
| 122 | * Due to Hardware errata for IDENTIFY DEVICE command, the controller cannot | ||
| 123 | * clear the BSY bit after receiving the PIO setup FIS. This results in the dma | ||
| 124 | * state machine goes into the CMFatalErrorUpdate state and locks up. By | ||
| 125 | * restarting the dma engine, it removes the controller out of lock up state. | ||
| 126 | */ | ||
| 127 | static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc) | ||
| 128 | { | ||
| 129 | struct ata_port *ap = qc->ap; | ||
| 130 | struct ahci_host_priv *hpriv = ap->host->private_data; | ||
| 131 | struct xgene_ahci_context *ctx = hpriv->plat_data; | ||
| 132 | int rc = 0; | ||
| 133 | |||
| 134 | if (unlikely(ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA)) | ||
| 135 | xgene_ahci_restart_engine(ap); | ||
| 136 | |||
| 137 | rc = ahci_qc_issue(qc); | ||
| 138 | |||
| 139 | /* Save the last command issued */ | ||
| 140 | ctx->last_cmd[ap->port_no] = qc->tf.command; | ||
| 141 | |||
| 142 | return rc; | ||
| 143 | } | ||
| 144 | |||
| 145 | /** | ||
| 101 | * xgene_ahci_read_id - Read ID data from the specified device | 146 | * xgene_ahci_read_id - Read ID data from the specified device |
| 102 | * @dev: device | 147 | * @dev: device |
| 103 | * @tf: proposed taskfile | 148 | * @tf: proposed taskfile |
| 104 | * @id: data buffer | 149 | * @id: data buffer |
| 105 | * | 150 | * |
| 106 | * This custom read ID function is required due to the fact that the HW | 151 | * This custom read ID function is required due to the fact that the HW |
| 107 | * does not support DEVSLP and the controller state machine may get stuck | 152 | * does not support DEVSLP. |
| 108 | * after processing the ID query command. | ||
| 109 | */ | 153 | */ |
| 110 | static unsigned int xgene_ahci_read_id(struct ata_device *dev, | 154 | static unsigned int xgene_ahci_read_id(struct ata_device *dev, |
| 111 | struct ata_taskfile *tf, u16 *id) | 155 | struct ata_taskfile *tf, u16 *id) |
| 112 | { | 156 | { |
| 113 | u32 err_mask; | 157 | u32 err_mask; |
| 114 | void __iomem *port_mmio = ahci_port_base(dev->link->ap); | ||
| 115 | 158 | ||
| 116 | err_mask = ata_do_dev_read_id(dev, tf, id); | 159 | err_mask = ata_do_dev_read_id(dev, tf, id); |
| 117 | if (err_mask) | 160 | if (err_mask) |
| @@ -133,16 +176,6 @@ static unsigned int xgene_ahci_read_id(struct ata_device *dev, | |||
| 133 | */ | 176 | */ |
| 134 | id[ATA_ID_FEATURE_SUPP] &= ~(1 << 8); | 177 | id[ATA_ID_FEATURE_SUPP] &= ~(1 << 8); |
| 135 | 178 | ||
| 136 | /* | ||
| 137 | * Due to HW errata, restart the port if no other command active. | ||
| 138 | * Otherwise the controller may get stuck. | ||
| 139 | */ | ||
| 140 | if (!readl(port_mmio + PORT_CMD_ISSUE)) { | ||
| 141 | writel(PORT_CMD_FIS_RX, port_mmio + PORT_CMD); | ||
| 142 | readl(port_mmio + PORT_CMD); /* Force a barrier */ | ||
| 143 | writel(PORT_CMD_FIS_RX | PORT_CMD_START, port_mmio + PORT_CMD); | ||
| 144 | readl(port_mmio + PORT_CMD); /* Force a barrier */ | ||
| 145 | } | ||
| 146 | return 0; | 179 | return 0; |
| 147 | } | 180 | } |
| 148 | 181 | ||
| @@ -300,6 +333,7 @@ static struct ata_port_operations xgene_ahci_ops = { | |||
| 300 | .host_stop = xgene_ahci_host_stop, | 333 | .host_stop = xgene_ahci_host_stop, |
| 301 | .hardreset = xgene_ahci_hardreset, | 334 | .hardreset = xgene_ahci_hardreset, |
| 302 | .read_id = xgene_ahci_read_id, | 335 | .read_id = xgene_ahci_read_id, |
| 336 | .qc_issue = xgene_ahci_qc_issue, | ||
| 303 | }; | 337 | }; |
| 304 | 338 | ||
| 305 | static const struct ata_port_info xgene_ahci_port_info = { | 339 | static const struct ata_port_info xgene_ahci_port_info = { |
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 40ea583d3610..d72ce0470309 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
| @@ -68,7 +68,6 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state, | |||
| 68 | 68 | ||
| 69 | static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); | 69 | static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); |
| 70 | static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); | 70 | static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); |
| 71 | static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc); | ||
| 72 | static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc); | 71 | static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc); |
| 73 | static int ahci_port_start(struct ata_port *ap); | 72 | static int ahci_port_start(struct ata_port *ap); |
| 74 | static void ahci_port_stop(struct ata_port *ap); | 73 | static void ahci_port_stop(struct ata_port *ap); |
| @@ -620,7 +619,7 @@ int ahci_stop_engine(struct ata_port *ap) | |||
| 620 | } | 619 | } |
| 621 | EXPORT_SYMBOL_GPL(ahci_stop_engine); | 620 | EXPORT_SYMBOL_GPL(ahci_stop_engine); |
| 622 | 621 | ||
| 623 | static void ahci_start_fis_rx(struct ata_port *ap) | 622 | void ahci_start_fis_rx(struct ata_port *ap) |
| 624 | { | 623 | { |
| 625 | void __iomem *port_mmio = ahci_port_base(ap); | 624 | void __iomem *port_mmio = ahci_port_base(ap); |
| 626 | struct ahci_host_priv *hpriv = ap->host->private_data; | 625 | struct ahci_host_priv *hpriv = ap->host->private_data; |
| @@ -646,6 +645,7 @@ static void ahci_start_fis_rx(struct ata_port *ap) | |||
| 646 | /* flush */ | 645 | /* flush */ |
| 647 | readl(port_mmio + PORT_CMD); | 646 | readl(port_mmio + PORT_CMD); |
| 648 | } | 647 | } |
| 648 | EXPORT_SYMBOL_GPL(ahci_start_fis_rx); | ||
| 649 | 649 | ||
| 650 | static int ahci_stop_fis_rx(struct ata_port *ap) | 650 | static int ahci_stop_fis_rx(struct ata_port *ap) |
| 651 | { | 651 | { |
| @@ -1945,7 +1945,7 @@ irqreturn_t ahci_interrupt(int irq, void *dev_instance) | |||
| 1945 | } | 1945 | } |
| 1946 | EXPORT_SYMBOL_GPL(ahci_interrupt); | 1946 | EXPORT_SYMBOL_GPL(ahci_interrupt); |
| 1947 | 1947 | ||
| 1948 | static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc) | 1948 | unsigned int ahci_qc_issue(struct ata_queued_cmd *qc) |
| 1949 | { | 1949 | { |
| 1950 | struct ata_port *ap = qc->ap; | 1950 | struct ata_port *ap = qc->ap; |
| 1951 | void __iomem *port_mmio = ahci_port_base(ap); | 1951 | void __iomem *port_mmio = ahci_port_base(ap); |
| @@ -1974,6 +1974,7 @@ static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc) | |||
| 1974 | 1974 | ||
| 1975 | return 0; | 1975 | return 0; |
| 1976 | } | 1976 | } |
| 1977 | EXPORT_SYMBOL_GPL(ahci_qc_issue); | ||
| 1977 | 1978 | ||
| 1978 | static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc) | 1979 | static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc) |
| 1979 | { | 1980 | { |
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index 3a5b4ed25a4f..b0077589f065 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c | |||
| @@ -250,8 +250,13 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev) | |||
| 250 | if (IS_ERR(hpriv->phy)) { | 250 | if (IS_ERR(hpriv->phy)) { |
| 251 | rc = PTR_ERR(hpriv->phy); | 251 | rc = PTR_ERR(hpriv->phy); |
| 252 | switch (rc) { | 252 | switch (rc) { |
| 253 | case -ENODEV: | ||
| 254 | case -ENOSYS: | 253 | case -ENOSYS: |
| 254 | /* No PHY support. Check if PHY is required. */ | ||
| 255 | if (of_find_property(dev->of_node, "phys", NULL)) { | ||
| 256 | dev_err(dev, "couldn't get sata-phy: ENOSYS\n"); | ||
| 257 | goto err_out; | ||
| 258 | } | ||
| 259 | case -ENODEV: | ||
| 255 | /* continue normally */ | 260 | /* continue normally */ |
| 256 | hpriv->phy = NULL; | 261 | hpriv->phy = NULL; |
| 257 | break; | 262 | break; |
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index d915707d2ba1..93dcad0c1cbe 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c | |||
| @@ -138,7 +138,9 @@ static int i8k_smm(struct smm_regs *regs) | |||
| 138 | if (!alloc_cpumask_var(&old_mask, GFP_KERNEL)) | 138 | if (!alloc_cpumask_var(&old_mask, GFP_KERNEL)) |
| 139 | return -ENOMEM; | 139 | return -ENOMEM; |
| 140 | cpumask_copy(old_mask, ¤t->cpus_allowed); | 140 | cpumask_copy(old_mask, ¤t->cpus_allowed); |
| 141 | set_cpus_allowed_ptr(current, cpumask_of(0)); | 141 | rc = set_cpus_allowed_ptr(current, cpumask_of(0)); |
| 142 | if (rc) | ||
| 143 | goto out; | ||
| 142 | if (smp_processor_id() != 0) { | 144 | if (smp_processor_id() != 0) { |
| 143 | rc = -EBUSY; | 145 | rc = -EBUSY; |
| 144 | goto out; | 146 | goto out; |
diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c index 9b7b5859a420..3757e9e72d37 100644 --- a/drivers/clk/clk-s2mps11.c +++ b/drivers/clk/clk-s2mps11.c | |||
| @@ -230,16 +230,13 @@ static int s2mps11_clk_probe(struct platform_device *pdev) | |||
| 230 | goto err_reg; | 230 | goto err_reg; |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | s2mps11_clk->lookup = devm_kzalloc(&pdev->dev, | 233 | s2mps11_clk->lookup = clkdev_alloc(s2mps11_clk->clk, |
| 234 | sizeof(struct clk_lookup), GFP_KERNEL); | 234 | s2mps11_name(s2mps11_clk), NULL); |
| 235 | if (!s2mps11_clk->lookup) { | 235 | if (!s2mps11_clk->lookup) { |
| 236 | ret = -ENOMEM; | 236 | ret = -ENOMEM; |
| 237 | goto err_lup; | 237 | goto err_lup; |
| 238 | } | 238 | } |
| 239 | 239 | ||
| 240 | s2mps11_clk->lookup->con_id = s2mps11_name(s2mps11_clk); | ||
| 241 | s2mps11_clk->lookup->clk = s2mps11_clk->clk; | ||
| 242 | |||
| 243 | clkdev_add(s2mps11_clk->lookup); | 240 | clkdev_add(s2mps11_clk->lookup); |
| 244 | } | 241 | } |
| 245 | 242 | ||
diff --git a/drivers/clk/qcom/mmcc-msm8960.c b/drivers/clk/qcom/mmcc-msm8960.c index 12f3c0b64fcd..4c449b3170f6 100644 --- a/drivers/clk/qcom/mmcc-msm8960.c +++ b/drivers/clk/qcom/mmcc-msm8960.c | |||
| @@ -1209,7 +1209,7 @@ static struct clk_branch rot_clk = { | |||
| 1209 | 1209 | ||
| 1210 | static u8 mmcc_pxo_hdmi_map[] = { | 1210 | static u8 mmcc_pxo_hdmi_map[] = { |
| 1211 | [P_PXO] = 0, | 1211 | [P_PXO] = 0, |
| 1212 | [P_HDMI_PLL] = 2, | 1212 | [P_HDMI_PLL] = 3, |
| 1213 | }; | 1213 | }; |
| 1214 | 1214 | ||
| 1215 | static const char *mmcc_pxo_hdmi[] = { | 1215 | static const char *mmcc_pxo_hdmi[] = { |
diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index 4f150c9dd38c..7f4a473a7ad7 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c | |||
| @@ -925,21 +925,13 @@ static struct samsung_gate_clock exynos4x12_gate_clks[] __initdata = { | |||
| 925 | GATE(CLK_RTC, "rtc", "aclk100", E4X12_GATE_IP_PERIR, 15, | 925 | GATE(CLK_RTC, "rtc", "aclk100", E4X12_GATE_IP_PERIR, 15, |
| 926 | 0, 0), | 926 | 0, 0), |
| 927 | GATE(CLK_KEYIF, "keyif", "aclk100", E4X12_GATE_IP_PERIR, 16, 0, 0), | 927 | GATE(CLK_KEYIF, "keyif", "aclk100", E4X12_GATE_IP_PERIR, 16, 0, 0), |
| 928 | GATE(CLK_SCLK_PWM_ISP, "sclk_pwm_isp", "div_pwm_isp", | 928 | GATE(CLK_PWM_ISP_SCLK, "pwm_isp_sclk", "div_pwm_isp", |
| 929 | E4X12_SRC_MASK_ISP, 0, CLK_SET_RATE_PARENT, 0), | ||
| 930 | GATE(CLK_SCLK_SPI0_ISP, "sclk_spi0_isp", "div_spi0_isp_pre", | ||
| 931 | E4X12_SRC_MASK_ISP, 4, CLK_SET_RATE_PARENT, 0), | ||
| 932 | GATE(CLK_SCLK_SPI1_ISP, "sclk_spi1_isp", "div_spi1_isp_pre", | ||
| 933 | E4X12_SRC_MASK_ISP, 8, CLK_SET_RATE_PARENT, 0), | ||
| 934 | GATE(CLK_SCLK_UART_ISP, "sclk_uart_isp", "div_uart_isp", | ||
| 935 | E4X12_SRC_MASK_ISP, 12, CLK_SET_RATE_PARENT, 0), | ||
| 936 | GATE(CLK_PWM_ISP_SCLK, "pwm_isp_sclk", "sclk_pwm_isp", | ||
| 937 | E4X12_GATE_IP_ISP, 0, 0, 0), | 929 | E4X12_GATE_IP_ISP, 0, 0, 0), |
| 938 | GATE(CLK_SPI0_ISP_SCLK, "spi0_isp_sclk", "sclk_spi0_isp", | 930 | GATE(CLK_SPI0_ISP_SCLK, "spi0_isp_sclk", "div_spi0_isp_pre", |
| 939 | E4X12_GATE_IP_ISP, 1, 0, 0), | 931 | E4X12_GATE_IP_ISP, 1, 0, 0), |
| 940 | GATE(CLK_SPI1_ISP_SCLK, "spi1_isp_sclk", "sclk_spi1_isp", | 932 | GATE(CLK_SPI1_ISP_SCLK, "spi1_isp_sclk", "div_spi1_isp_pre", |
| 941 | E4X12_GATE_IP_ISP, 2, 0, 0), | 933 | E4X12_GATE_IP_ISP, 2, 0, 0), |
| 942 | GATE(CLK_UART_ISP_SCLK, "uart_isp_sclk", "sclk_uart_isp", | 934 | GATE(CLK_UART_ISP_SCLK, "uart_isp_sclk", "div_uart_isp", |
| 943 | E4X12_GATE_IP_ISP, 3, 0, 0), | 935 | E4X12_GATE_IP_ISP, 3, 0, 0), |
| 944 | GATE(CLK_WDT, "watchdog", "aclk100", E4X12_GATE_IP_PERIR, 14, 0, 0), | 936 | GATE(CLK_WDT, "watchdog", "aclk100", E4X12_GATE_IP_PERIR, 14, 0, 0), |
| 945 | GATE(CLK_PCM0, "pcm0", "aclk100", E4X12_GATE_IP_MAUDIO, 2, | 937 | GATE(CLK_PCM0, "pcm0", "aclk100", E4X12_GATE_IP_MAUDIO, 2, |
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c index 1fad4c5e3f5d..184f64293b26 100644 --- a/drivers/clk/samsung/clk-exynos5250.c +++ b/drivers/clk/samsung/clk-exynos5250.c | |||
| @@ -661,7 +661,7 @@ static struct samsung_gate_clock exynos5250_gate_clks[] __initdata = { | |||
| 661 | GATE(CLK_RTC, "rtc", "div_aclk66", GATE_IP_PERIS, 20, 0, 0), | 661 | GATE(CLK_RTC, "rtc", "div_aclk66", GATE_IP_PERIS, 20, 0, 0), |
| 662 | GATE(CLK_TMU, "tmu", "div_aclk66", GATE_IP_PERIS, 21, 0, 0), | 662 | GATE(CLK_TMU, "tmu", "div_aclk66", GATE_IP_PERIS, 21, 0, 0), |
| 663 | GATE(CLK_SMMU_TV, "smmu_tv", "mout_aclk200_disp1_sub", | 663 | GATE(CLK_SMMU_TV, "smmu_tv", "mout_aclk200_disp1_sub", |
| 664 | GATE_IP_DISP1, 2, 0, 0), | 664 | GATE_IP_DISP1, 9, 0, 0), |
| 665 | GATE(CLK_SMMU_FIMD1, "smmu_fimd1", "mout_aclk200_disp1_sub", | 665 | GATE(CLK_SMMU_FIMD1, "smmu_fimd1", "mout_aclk200_disp1_sub", |
| 666 | GATE_IP_DISP1, 8, 0, 0), | 666 | GATE_IP_DISP1, 8, 0, 0), |
| 667 | GATE(CLK_SMMU_2D, "smmu_2d", "div_aclk200", GATE_IP_ACP, 7, 0, 0), | 667 | GATE(CLK_SMMU_2D, "smmu_2d", "div_aclk200", GATE_IP_ACP, 7, 0, 0), |
diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c index 9d7d7eed03fd..a4e6cc782e5c 100644 --- a/drivers/clk/samsung/clk-exynos5420.c +++ b/drivers/clk/samsung/clk-exynos5420.c | |||
| @@ -631,7 +631,8 @@ static struct samsung_mux_clock exynos5x_mux_clks[] __initdata = { | |||
| 631 | SRC_TOP4, 16, 1), | 631 | SRC_TOP4, 16, 1), |
| 632 | MUX(0, "mout_user_aclk266", mout_user_aclk266_p, SRC_TOP4, 20, 1), | 632 | MUX(0, "mout_user_aclk266", mout_user_aclk266_p, SRC_TOP4, 20, 1), |
| 633 | MUX(0, "mout_user_aclk166", mout_user_aclk166_p, SRC_TOP4, 24, 1), | 633 | MUX(0, "mout_user_aclk166", mout_user_aclk166_p, SRC_TOP4, 24, 1), |
| 634 | MUX(0, "mout_user_aclk333", mout_user_aclk333_p, SRC_TOP4, 28, 1), | 634 | MUX(CLK_MOUT_USER_ACLK333, "mout_user_aclk333", mout_user_aclk333_p, |
| 635 | SRC_TOP4, 28, 1), | ||
| 635 | 636 | ||
| 636 | MUX(0, "mout_user_aclk400_disp1", mout_user_aclk400_disp1_p, | 637 | MUX(0, "mout_user_aclk400_disp1", mout_user_aclk400_disp1_p, |
| 637 | SRC_TOP5, 0, 1), | 638 | SRC_TOP5, 0, 1), |
| @@ -684,7 +685,8 @@ static struct samsung_mux_clock exynos5x_mux_clks[] __initdata = { | |||
| 684 | SRC_TOP11, 12, 1), | 685 | SRC_TOP11, 12, 1), |
| 685 | MUX(0, "mout_sw_aclk266", mout_sw_aclk266_p, SRC_TOP11, 20, 1), | 686 | MUX(0, "mout_sw_aclk266", mout_sw_aclk266_p, SRC_TOP11, 20, 1), |
| 686 | MUX(0, "mout_sw_aclk166", mout_sw_aclk166_p, SRC_TOP11, 24, 1), | 687 | MUX(0, "mout_sw_aclk166", mout_sw_aclk166_p, SRC_TOP11, 24, 1), |
| 687 | MUX(0, "mout_sw_aclk333", mout_sw_aclk333_p, SRC_TOP11, 28, 1), | 688 | MUX(CLK_MOUT_SW_ACLK333, "mout_sw_aclk333", mout_sw_aclk333_p, |
| 689 | SRC_TOP11, 28, 1), | ||
| 688 | 690 | ||
| 689 | MUX(0, "mout_sw_aclk400_disp1", mout_sw_aclk400_disp1_p, | 691 | MUX(0, "mout_sw_aclk400_disp1", mout_sw_aclk400_disp1_p, |
| 690 | SRC_TOP12, 4, 1), | 692 | SRC_TOP12, 4, 1), |
| @@ -890,8 +892,6 @@ static struct samsung_gate_clock exynos5x_gate_clks[] __initdata = { | |||
| 890 | GATE_BUS_TOP, 9, CLK_IGNORE_UNUSED, 0), | 892 | GATE_BUS_TOP, 9, CLK_IGNORE_UNUSED, 0), |
| 891 | GATE(0, "aclk66_psgen", "mout_user_aclk66_psgen", | 893 | GATE(0, "aclk66_psgen", "mout_user_aclk66_psgen", |
| 892 | GATE_BUS_TOP, 10, CLK_IGNORE_UNUSED, 0), | 894 | GATE_BUS_TOP, 10, CLK_IGNORE_UNUSED, 0), |
| 893 | GATE(CLK_ACLK66_PERIC, "aclk66_peric", "mout_user_aclk66_peric", | ||
| 894 | GATE_BUS_TOP, 11, CLK_IGNORE_UNUSED, 0), | ||
| 895 | GATE(0, "aclk266_isp", "mout_user_aclk266_isp", | 895 | GATE(0, "aclk266_isp", "mout_user_aclk266_isp", |
| 896 | GATE_BUS_TOP, 13, 0, 0), | 896 | GATE_BUS_TOP, 13, 0, 0), |
| 897 | GATE(0, "aclk166", "mout_user_aclk166", | 897 | GATE(0, "aclk166", "mout_user_aclk166", |
| @@ -994,34 +994,61 @@ static struct samsung_gate_clock exynos5x_gate_clks[] __initdata = { | |||
| 994 | SRC_MASK_FSYS, 24, CLK_SET_RATE_PARENT, 0), | 994 | SRC_MASK_FSYS, 24, CLK_SET_RATE_PARENT, 0), |
| 995 | 995 | ||
| 996 | /* PERIC Block */ | 996 | /* PERIC Block */ |
| 997 | GATE(CLK_UART0, "uart0", "aclk66_peric", GATE_IP_PERIC, 0, 0, 0), | 997 | GATE(CLK_UART0, "uart0", "mout_user_aclk66_peric", |
| 998 | GATE(CLK_UART1, "uart1", "aclk66_peric", GATE_IP_PERIC, 1, 0, 0), | 998 | GATE_IP_PERIC, 0, 0, 0), |
| 999 | GATE(CLK_UART2, "uart2", "aclk66_peric", GATE_IP_PERIC, 2, 0, 0), | 999 | GATE(CLK_UART1, "uart1", "mout_user_aclk66_peric", |
| 1000 | GATE(CLK_UART3, "uart3", "aclk66_peric", GATE_IP_PERIC, 3, 0, 0), | 1000 | GATE_IP_PERIC, 1, 0, 0), |
| 1001 | GATE(CLK_I2C0, "i2c0", "aclk66_peric", GATE_IP_PERIC, 6, 0, 0), | 1001 | GATE(CLK_UART2, "uart2", "mout_user_aclk66_peric", |
| 1002 | GATE(CLK_I2C1, "i2c1", "aclk66_peric", GATE_IP_PERIC, 7, 0, 0), | 1002 | GATE_IP_PERIC, 2, 0, 0), |
| 1003 | GATE(CLK_I2C2, "i2c2", "aclk66_peric", GATE_IP_PERIC, 8, 0, 0), | 1003 | GATE(CLK_UART3, "uart3", "mout_user_aclk66_peric", |
| 1004 | GATE(CLK_I2C3, "i2c3", "aclk66_peric", GATE_IP_PERIC, 9, 0, 0), | 1004 | GATE_IP_PERIC, 3, 0, 0), |
| 1005 | GATE(CLK_USI0, "usi0", "aclk66_peric", GATE_IP_PERIC, 10, 0, 0), | 1005 | GATE(CLK_I2C0, "i2c0", "mout_user_aclk66_peric", |
| 1006 | GATE(CLK_USI1, "usi1", "aclk66_peric", GATE_IP_PERIC, 11, 0, 0), | 1006 | GATE_IP_PERIC, 6, 0, 0), |
| 1007 | GATE(CLK_USI2, "usi2", "aclk66_peric", GATE_IP_PERIC, 12, 0, 0), | 1007 | GATE(CLK_I2C1, "i2c1", "mout_user_aclk66_peric", |
| 1008 | GATE(CLK_USI3, "usi3", "aclk66_peric", GATE_IP_PERIC, 13, 0, 0), | 1008 | GATE_IP_PERIC, 7, 0, 0), |
| 1009 | GATE(CLK_I2C_HDMI, "i2c_hdmi", "aclk66_peric", GATE_IP_PERIC, 14, 0, 0), | 1009 | GATE(CLK_I2C2, "i2c2", "mout_user_aclk66_peric", |
| 1010 | GATE(CLK_TSADC, "tsadc", "aclk66_peric", GATE_IP_PERIC, 15, 0, 0), | 1010 | GATE_IP_PERIC, 8, 0, 0), |
| 1011 | GATE(CLK_SPI0, "spi0", "aclk66_peric", GATE_IP_PERIC, 16, 0, 0), | 1011 | GATE(CLK_I2C3, "i2c3", "mout_user_aclk66_peric", |
| 1012 | GATE(CLK_SPI1, "spi1", "aclk66_peric", GATE_IP_PERIC, 17, 0, 0), | 1012 | GATE_IP_PERIC, 9, 0, 0), |
| 1013 | GATE(CLK_SPI2, "spi2", "aclk66_peric", GATE_IP_PERIC, 18, 0, 0), | 1013 | GATE(CLK_USI0, "usi0", "mout_user_aclk66_peric", |
| 1014 | GATE(CLK_I2S1, "i2s1", "aclk66_peric", GATE_IP_PERIC, 20, 0, 0), | 1014 | GATE_IP_PERIC, 10, 0, 0), |
| 1015 | GATE(CLK_I2S2, "i2s2", "aclk66_peric", GATE_IP_PERIC, 21, 0, 0), | 1015 | GATE(CLK_USI1, "usi1", "mout_user_aclk66_peric", |
| 1016 | GATE(CLK_PCM1, "pcm1", "aclk66_peric", GATE_IP_PERIC, 22, 0, 0), | 1016 | GATE_IP_PERIC, 11, 0, 0), |
| 1017 | GATE(CLK_PCM2, "pcm2", "aclk66_peric", GATE_IP_PERIC, 23, 0, 0), | 1017 | GATE(CLK_USI2, "usi2", "mout_user_aclk66_peric", |
| 1018 | GATE(CLK_PWM, "pwm", "aclk66_peric", GATE_IP_PERIC, 24, 0, 0), | 1018 | GATE_IP_PERIC, 12, 0, 0), |
| 1019 | GATE(CLK_SPDIF, "spdif", "aclk66_peric", GATE_IP_PERIC, 26, 0, 0), | 1019 | GATE(CLK_USI3, "usi3", "mout_user_aclk66_peric", |
| 1020 | GATE(CLK_USI4, "usi4", "aclk66_peric", GATE_IP_PERIC, 28, 0, 0), | 1020 | GATE_IP_PERIC, 13, 0, 0), |
| 1021 | GATE(CLK_USI5, "usi5", "aclk66_peric", GATE_IP_PERIC, 30, 0, 0), | 1021 | GATE(CLK_I2C_HDMI, "i2c_hdmi", "mout_user_aclk66_peric", |
| 1022 | GATE(CLK_USI6, "usi6", "aclk66_peric", GATE_IP_PERIC, 31, 0, 0), | 1022 | GATE_IP_PERIC, 14, 0, 0), |
| 1023 | 1023 | GATE(CLK_TSADC, "tsadc", "mout_user_aclk66_peric", | |
| 1024 | GATE(CLK_KEYIF, "keyif", "aclk66_peric", GATE_BUS_PERIC, 22, 0, 0), | 1024 | GATE_IP_PERIC, 15, 0, 0), |
| 1025 | GATE(CLK_SPI0, "spi0", "mout_user_aclk66_peric", | ||
| 1026 | GATE_IP_PERIC, 16, 0, 0), | ||
| 1027 | GATE(CLK_SPI1, "spi1", "mout_user_aclk66_peric", | ||
| 1028 | GATE_IP_PERIC, 17, 0, 0), | ||
| 1029 | GATE(CLK_SPI2, "spi2", "mout_user_aclk66_peric", | ||
| 1030 | GATE_IP_PERIC, 18, 0, 0), | ||
| 1031 | GATE(CLK_I2S1, "i2s1", "mout_user_aclk66_peric", | ||
| 1032 | GATE_IP_PERIC, 20, 0, 0), | ||
| 1033 | GATE(CLK_I2S2, "i2s2", "mout_user_aclk66_peric", | ||
| 1034 | GATE_IP_PERIC, 21, 0, 0), | ||
| 1035 | GATE(CLK_PCM1, "pcm1", "mout_user_aclk66_peric", | ||
| 1036 | GATE_IP_PERIC, 22, 0, 0), | ||
| 1037 | GATE(CLK_PCM2, "pcm2", "mout_user_aclk66_peric", | ||
| 1038 | GATE_IP_PERIC, 23, 0, 0), | ||
| 1039 | GATE(CLK_PWM, "pwm", "mout_user_aclk66_peric", | ||
| 1040 | GATE_IP_PERIC, 24, 0, 0), | ||
| 1041 | GATE(CLK_SPDIF, "spdif", "mout_user_aclk66_peric", | ||
| 1042 | GATE_IP_PERIC, 26, 0, 0), | ||
| 1043 | GATE(CLK_USI4, "usi4", "mout_user_aclk66_peric", | ||
| 1044 | GATE_IP_PERIC, 28, 0, 0), | ||
| 1045 | GATE(CLK_USI5, "usi5", "mout_user_aclk66_peric", | ||
| 1046 | GATE_IP_PERIC, 30, 0, 0), | ||
| 1047 | GATE(CLK_USI6, "usi6", "mout_user_aclk66_peric", | ||
| 1048 | GATE_IP_PERIC, 31, 0, 0), | ||
| 1049 | |||
| 1050 | GATE(CLK_KEYIF, "keyif", "mout_user_aclk66_peric", | ||
| 1051 | GATE_BUS_PERIC, 22, 0, 0), | ||
| 1025 | 1052 | ||
| 1026 | /* PERIS Block */ | 1053 | /* PERIS Block */ |
| 1027 | GATE(CLK_CHIPID, "chipid", "aclk66_psgen", | 1054 | GATE(CLK_CHIPID, "chipid", "aclk66_psgen", |
diff --git a/drivers/clk/samsung/clk-s3c2410.c b/drivers/clk/samsung/clk-s3c2410.c index ba0716801db2..140f4733c02e 100644 --- a/drivers/clk/samsung/clk-s3c2410.c +++ b/drivers/clk/samsung/clk-s3c2410.c | |||
| @@ -152,6 +152,11 @@ struct samsung_clock_alias s3c2410_common_aliases[] __initdata = { | |||
| 152 | ALIAS(HCLK, NULL, "hclk"), | 152 | ALIAS(HCLK, NULL, "hclk"), |
| 153 | ALIAS(MPLL, NULL, "mpll"), | 153 | ALIAS(MPLL, NULL, "mpll"), |
| 154 | ALIAS(FCLK, NULL, "fclk"), | 154 | ALIAS(FCLK, NULL, "fclk"), |
| 155 | ALIAS(PCLK, NULL, "watchdog"), | ||
| 156 | ALIAS(PCLK_SDI, NULL, "sdi"), | ||
| 157 | ALIAS(HCLK_NAND, NULL, "nand"), | ||
| 158 | ALIAS(PCLK_I2S, NULL, "iis"), | ||
| 159 | ALIAS(PCLK_I2C, NULL, "i2c"), | ||
| 155 | }; | 160 | }; |
| 156 | 161 | ||
| 157 | /* S3C2410 specific clocks */ | 162 | /* S3C2410 specific clocks */ |
| @@ -378,7 +383,7 @@ void __init s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f, | |||
| 378 | if (!np) | 383 | if (!np) |
| 379 | s3c2410_common_clk_register_fixed_ext(ctx, xti_f); | 384 | s3c2410_common_clk_register_fixed_ext(ctx, xti_f); |
| 380 | 385 | ||
| 381 | if (current_soc == 2410) { | 386 | if (current_soc == S3C2410) { |
| 382 | if (_get_rate("xti") == 12 * MHZ) { | 387 | if (_get_rate("xti") == 12 * MHZ) { |
| 383 | s3c2410_plls[mpll].rate_table = pll_s3c2410_12mhz_tbl; | 388 | s3c2410_plls[mpll].rate_table = pll_s3c2410_12mhz_tbl; |
| 384 | s3c2410_plls[upll].rate_table = pll_s3c2410_12mhz_tbl; | 389 | s3c2410_plls[upll].rate_table = pll_s3c2410_12mhz_tbl; |
| @@ -432,7 +437,7 @@ void __init s3c2410_common_clk_init(struct device_node *np, unsigned long xti_f, | |||
| 432 | samsung_clk_register_fixed_factor(ctx, s3c2410_ffactor, | 437 | samsung_clk_register_fixed_factor(ctx, s3c2410_ffactor, |
| 433 | ARRAY_SIZE(s3c2410_ffactor)); | 438 | ARRAY_SIZE(s3c2410_ffactor)); |
| 434 | samsung_clk_register_alias(ctx, s3c2410_aliases, | 439 | samsung_clk_register_alias(ctx, s3c2410_aliases, |
| 435 | ARRAY_SIZE(s3c2410_common_aliases)); | 440 | ARRAY_SIZE(s3c2410_aliases)); |
| 436 | break; | 441 | break; |
| 437 | case S3C2440: | 442 | case S3C2440: |
| 438 | samsung_clk_register_mux(ctx, s3c2440_muxes, | 443 | samsung_clk_register_mux(ctx, s3c2440_muxes, |
diff --git a/drivers/clk/samsung/clk-s3c64xx.c b/drivers/clk/samsung/clk-s3c64xx.c index efa16ee592c8..8889ff1c10fc 100644 --- a/drivers/clk/samsung/clk-s3c64xx.c +++ b/drivers/clk/samsung/clk-s3c64xx.c | |||
| @@ -418,8 +418,10 @@ static struct samsung_clock_alias s3c64xx_clock_aliases[] = { | |||
| 418 | ALIAS(SCLK_MMC2, "s3c-sdhci.2", "mmc_busclk.2"), | 418 | ALIAS(SCLK_MMC2, "s3c-sdhci.2", "mmc_busclk.2"), |
| 419 | ALIAS(SCLK_MMC1, "s3c-sdhci.1", "mmc_busclk.2"), | 419 | ALIAS(SCLK_MMC1, "s3c-sdhci.1", "mmc_busclk.2"), |
| 420 | ALIAS(SCLK_MMC0, "s3c-sdhci.0", "mmc_busclk.2"), | 420 | ALIAS(SCLK_MMC0, "s3c-sdhci.0", "mmc_busclk.2"), |
| 421 | ALIAS(SCLK_SPI1, "s3c6410-spi.1", "spi-bus"), | 421 | ALIAS(PCLK_SPI1, "s3c6410-spi.1", "spi_busclk0"), |
| 422 | ALIAS(SCLK_SPI0, "s3c6410-spi.0", "spi-bus"), | 422 | ALIAS(SCLK_SPI1, "s3c6410-spi.1", "spi_busclk2"), |
| 423 | ALIAS(PCLK_SPI0, "s3c6410-spi.0", "spi_busclk0"), | ||
| 424 | ALIAS(SCLK_SPI0, "s3c6410-spi.0", "spi_busclk2"), | ||
| 423 | ALIAS(SCLK_AUDIO1, "samsung-pcm.1", "audio-bus"), | 425 | ALIAS(SCLK_AUDIO1, "samsung-pcm.1", "audio-bus"), |
| 424 | ALIAS(SCLK_AUDIO1, "samsung-i2s.1", "audio-bus"), | 426 | ALIAS(SCLK_AUDIO1, "samsung-i2s.1", "audio-bus"), |
| 425 | ALIAS(SCLK_AUDIO0, "samsung-pcm.0", "audio-bus"), | 427 | ALIAS(SCLK_AUDIO0, "samsung-pcm.0", "audio-bus"), |
diff --git a/drivers/clk/spear/spear3xx_clock.c b/drivers/clk/spear/spear3xx_clock.c index c2d204315546..bb5f387774e2 100644 --- a/drivers/clk/spear/spear3xx_clock.c +++ b/drivers/clk/spear/spear3xx_clock.c | |||
| @@ -211,7 +211,7 @@ static inline void spear310_clk_init(void) { } | |||
| 211 | /* array of all spear 320 clock lookups */ | 211 | /* array of all spear 320 clock lookups */ |
| 212 | #ifdef CONFIG_MACH_SPEAR320 | 212 | #ifdef CONFIG_MACH_SPEAR320 |
| 213 | 213 | ||
| 214 | #define SPEAR320_CONTROL_REG (soc_config_base + 0x0000) | 214 | #define SPEAR320_CONTROL_REG (soc_config_base + 0x0010) |
| 215 | #define SPEAR320_EXT_CTRL_REG (soc_config_base + 0x0018) | 215 | #define SPEAR320_EXT_CTRL_REG (soc_config_base + 0x0018) |
| 216 | 216 | ||
| 217 | #define SPEAR320_UARTX_PCLK_MASK 0x1 | 217 | #define SPEAR320_UARTX_PCLK_MASK 0x1 |
| @@ -245,7 +245,8 @@ static const char *smii0_parents[] = { "smii_125m_pad", "ras_pll2_clk", | |||
| 245 | "ras_syn0_gclk", }; | 245 | "ras_syn0_gclk", }; |
| 246 | static const char *uartx_parents[] = { "ras_syn1_gclk", "ras_apb_clk", }; | 246 | static const char *uartx_parents[] = { "ras_syn1_gclk", "ras_apb_clk", }; |
| 247 | 247 | ||
| 248 | static void __init spear320_clk_init(void __iomem *soc_config_base) | 248 | static void __init spear320_clk_init(void __iomem *soc_config_base, |
| 249 | struct clk *ras_apb_clk) | ||
| 249 | { | 250 | { |
| 250 | struct clk *clk; | 251 | struct clk *clk; |
| 251 | 252 | ||
| @@ -342,6 +343,8 @@ static void __init spear320_clk_init(void __iomem *soc_config_base) | |||
| 342 | SPEAR320_CONTROL_REG, UART1_PCLK_SHIFT, UART1_PCLK_MASK, | 343 | SPEAR320_CONTROL_REG, UART1_PCLK_SHIFT, UART1_PCLK_MASK, |
| 343 | 0, &_lock); | 344 | 0, &_lock); |
| 344 | clk_register_clkdev(clk, NULL, "a3000000.serial"); | 345 | clk_register_clkdev(clk, NULL, "a3000000.serial"); |
| 346 | /* Enforce ras_apb_clk */ | ||
| 347 | clk_set_parent(clk, ras_apb_clk); | ||
| 345 | 348 | ||
| 346 | clk = clk_register_mux(NULL, "uart2_clk", uartx_parents, | 349 | clk = clk_register_mux(NULL, "uart2_clk", uartx_parents, |
| 347 | ARRAY_SIZE(uartx_parents), | 350 | ARRAY_SIZE(uartx_parents), |
| @@ -349,6 +352,8 @@ static void __init spear320_clk_init(void __iomem *soc_config_base) | |||
| 349 | SPEAR320_EXT_CTRL_REG, SPEAR320_UART2_PCLK_SHIFT, | 352 | SPEAR320_EXT_CTRL_REG, SPEAR320_UART2_PCLK_SHIFT, |
| 350 | SPEAR320_UARTX_PCLK_MASK, 0, &_lock); | 353 | SPEAR320_UARTX_PCLK_MASK, 0, &_lock); |
| 351 | clk_register_clkdev(clk, NULL, "a4000000.serial"); | 354 | clk_register_clkdev(clk, NULL, "a4000000.serial"); |
| 355 | /* Enforce ras_apb_clk */ | ||
| 356 | clk_set_parent(clk, ras_apb_clk); | ||
| 352 | 357 | ||
| 353 | clk = clk_register_mux(NULL, "uart3_clk", uartx_parents, | 358 | clk = clk_register_mux(NULL, "uart3_clk", uartx_parents, |
| 354 | ARRAY_SIZE(uartx_parents), | 359 | ARRAY_SIZE(uartx_parents), |
| @@ -379,12 +384,12 @@ static void __init spear320_clk_init(void __iomem *soc_config_base) | |||
| 379 | clk_register_clkdev(clk, NULL, "60100000.serial"); | 384 | clk_register_clkdev(clk, NULL, "60100000.serial"); |
| 380 | } | 385 | } |
| 381 | #else | 386 | #else |
| 382 | static inline void spear320_clk_init(void __iomem *soc_config_base) { } | 387 | static inline void spear320_clk_init(void __iomem *sb, struct clk *rc) { } |
| 383 | #endif | 388 | #endif |
| 384 | 389 | ||
| 385 | void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_base) | 390 | void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_base) |
| 386 | { | 391 | { |
| 387 | struct clk *clk, *clk1; | 392 | struct clk *clk, *clk1, *ras_apb_clk; |
| 388 | 393 | ||
| 389 | clk = clk_register_fixed_rate(NULL, "osc_32k_clk", NULL, CLK_IS_ROOT, | 394 | clk = clk_register_fixed_rate(NULL, "osc_32k_clk", NULL, CLK_IS_ROOT, |
| 390 | 32000); | 395 | 32000); |
| @@ -613,6 +618,7 @@ void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_ | |||
| 613 | clk = clk_register_gate(NULL, "ras_apb_clk", "apb_clk", 0, RAS_CLK_ENB, | 618 | clk = clk_register_gate(NULL, "ras_apb_clk", "apb_clk", 0, RAS_CLK_ENB, |
| 614 | RAS_APB_CLK_ENB, 0, &_lock); | 619 | RAS_APB_CLK_ENB, 0, &_lock); |
| 615 | clk_register_clkdev(clk, "ras_apb_clk", NULL); | 620 | clk_register_clkdev(clk, "ras_apb_clk", NULL); |
| 621 | ras_apb_clk = clk; | ||
| 616 | 622 | ||
| 617 | clk = clk_register_gate(NULL, "ras_32k_clk", "osc_32k_clk", 0, | 623 | clk = clk_register_gate(NULL, "ras_32k_clk", "osc_32k_clk", 0, |
| 618 | RAS_CLK_ENB, RAS_32K_CLK_ENB, 0, &_lock); | 624 | RAS_CLK_ENB, RAS_32K_CLK_ENB, 0, &_lock); |
| @@ -659,5 +665,5 @@ void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_ | |||
| 659 | else if (of_machine_is_compatible("st,spear310")) | 665 | else if (of_machine_is_compatible("st,spear310")) |
| 660 | spear310_clk_init(); | 666 | spear310_clk_init(); |
| 661 | else if (of_machine_is_compatible("st,spear320")) | 667 | else if (of_machine_is_compatible("st,spear320")) |
| 662 | spear320_clk_init(soc_config_base); | 668 | spear320_clk_init(soc_config_base, ras_apb_clk); |
| 663 | } | 669 | } |
diff --git a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c index 44cd27c5c401..670f90d629d7 100644 --- a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c +++ b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c | |||
| @@ -29,7 +29,7 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev) | |||
| 29 | 29 | ||
| 30 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 30 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 31 | reg = devm_ioremap_resource(&pdev->dev, r); | 31 | reg = devm_ioremap_resource(&pdev->dev, r); |
| 32 | if (!reg) | 32 | if (IS_ERR(reg)) |
| 33 | return PTR_ERR(reg); | 33 | return PTR_ERR(reg); |
| 34 | 34 | ||
| 35 | clk_parent = of_clk_get_parent_name(np, 0); | 35 | clk_parent = of_clk_get_parent_name(np, 0); |
diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c index 5428c9c547cd..72d97279eae1 100644 --- a/drivers/clk/ti/apll.c +++ b/drivers/clk/ti/apll.c | |||
| @@ -77,13 +77,11 @@ static int dra7_apll_enable(struct clk_hw *hw) | |||
| 77 | if (i == MAX_APLL_WAIT_TRIES) { | 77 | if (i == MAX_APLL_WAIT_TRIES) { |
| 78 | pr_warn("clock: %s failed transition to '%s'\n", | 78 | pr_warn("clock: %s failed transition to '%s'\n", |
| 79 | clk_name, (state) ? "locked" : "bypassed"); | 79 | clk_name, (state) ? "locked" : "bypassed"); |
| 80 | } else { | 80 | r = -EBUSY; |
| 81 | } else | ||
| 81 | pr_debug("clock: %s transition to '%s' in %d loops\n", | 82 | pr_debug("clock: %s transition to '%s' in %d loops\n", |
| 82 | clk_name, (state) ? "locked" : "bypassed", i); | 83 | clk_name, (state) ? "locked" : "bypassed", i); |
| 83 | 84 | ||
| 84 | r = 0; | ||
| 85 | } | ||
| 86 | |||
| 87 | return r; | 85 | return r; |
| 88 | } | 86 | } |
| 89 | 87 | ||
| @@ -338,7 +336,7 @@ static void __init of_omap2_apll_setup(struct device_node *node) | |||
| 338 | const char *parent_name; | 336 | const char *parent_name; |
| 339 | u32 val; | 337 | u32 val; |
| 340 | 338 | ||
| 341 | ad = kzalloc(sizeof(*clk_hw), GFP_KERNEL); | 339 | ad = kzalloc(sizeof(*ad), GFP_KERNEL); |
| 342 | clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); | 340 | clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); |
| 343 | init = kzalloc(sizeof(*init), GFP_KERNEL); | 341 | init = kzalloc(sizeof(*init), GFP_KERNEL); |
| 344 | 342 | ||
diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c index abd956d5f838..79791e1bf282 100644 --- a/drivers/clk/ti/dpll.c +++ b/drivers/clk/ti/dpll.c | |||
| @@ -161,7 +161,8 @@ cleanup: | |||
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ | 163 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ |
| 164 | defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM33XX) | 164 | defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM33XX) || \ |
| 165 | defined(CONFIG_SOC_AM43XX) | ||
| 165 | /** | 166 | /** |
| 166 | * ti_clk_register_dpll_x2 - Registers a DPLLx2 clock | 167 | * ti_clk_register_dpll_x2 - Registers a DPLLx2 clock |
| 167 | * @node: device node for this clock | 168 | * @node: device node for this clock |
| @@ -322,7 +323,7 @@ CLK_OF_DECLARE(ti_omap4_dpll_x2_clock, "ti,omap4-dpll-x2-clock", | |||
| 322 | of_ti_omap4_dpll_x2_setup); | 323 | of_ti_omap4_dpll_x2_setup); |
| 323 | #endif | 324 | #endif |
| 324 | 325 | ||
| 325 | #ifdef CONFIG_SOC_AM33XX | 326 | #if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX) |
| 326 | static void __init of_ti_am3_dpll_x2_setup(struct device_node *node) | 327 | static void __init of_ti_am3_dpll_x2_setup(struct device_node *node) |
| 327 | { | 328 | { |
| 328 | ti_clk_register_dpll_x2(node, &dpll_x2_ck_ops, NULL); | 329 | ti_clk_register_dpll_x2(node, &dpll_x2_ck_ops, NULL); |
diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c index 0197a478720c..e9d650e51287 100644 --- a/drivers/clk/ti/mux.c +++ b/drivers/clk/ti/mux.c | |||
| @@ -160,7 +160,7 @@ static void of_mux_clk_setup(struct device_node *node) | |||
| 160 | u8 clk_mux_flags = 0; | 160 | u8 clk_mux_flags = 0; |
| 161 | u32 mask = 0; | 161 | u32 mask = 0; |
| 162 | u32 shift = 0; | 162 | u32 shift = 0; |
| 163 | u32 flags = 0; | 163 | u32 flags = CLK_SET_RATE_NO_REPARENT; |
| 164 | 164 | ||
| 165 | num_parents = of_clk_get_parent_count(node); | 165 | num_parents = of_clk_get_parent_count(node); |
| 166 | if (num_parents < 2) { | 166 | if (num_parents < 2) { |
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index f71d55f5e6e5..ab51bf20a3ed 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c | |||
| @@ -162,7 +162,7 @@ static void exynos4_mct_frc_start(void) | |||
| 162 | exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON); | 162 | exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON); |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | static cycle_t exynos4_frc_read(struct clocksource *cs) | 165 | static cycle_t notrace _exynos4_frc_read(void) |
| 166 | { | 166 | { |
| 167 | unsigned int lo, hi; | 167 | unsigned int lo, hi; |
| 168 | u32 hi2 = __raw_readl(reg_base + EXYNOS4_MCT_G_CNT_U); | 168 | u32 hi2 = __raw_readl(reg_base + EXYNOS4_MCT_G_CNT_U); |
| @@ -176,6 +176,11 @@ static cycle_t exynos4_frc_read(struct clocksource *cs) | |||
| 176 | return ((cycle_t)hi << 32) | lo; | 176 | return ((cycle_t)hi << 32) | lo; |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | static cycle_t exynos4_frc_read(struct clocksource *cs) | ||
| 180 | { | ||
| 181 | return _exynos4_frc_read(); | ||
| 182 | } | ||
| 183 | |||
| 179 | static void exynos4_frc_resume(struct clocksource *cs) | 184 | static void exynos4_frc_resume(struct clocksource *cs) |
| 180 | { | 185 | { |
| 181 | exynos4_mct_frc_start(); | 186 | exynos4_mct_frc_start(); |
| @@ -192,13 +197,24 @@ struct clocksource mct_frc = { | |||
| 192 | 197 | ||
| 193 | static u64 notrace exynos4_read_sched_clock(void) | 198 | static u64 notrace exynos4_read_sched_clock(void) |
| 194 | { | 199 | { |
| 195 | return exynos4_frc_read(&mct_frc); | 200 | return _exynos4_frc_read(); |
| 201 | } | ||
| 202 | |||
| 203 | static struct delay_timer exynos4_delay_timer; | ||
| 204 | |||
| 205 | static cycles_t exynos4_read_current_timer(void) | ||
| 206 | { | ||
| 207 | return _exynos4_frc_read(); | ||
| 196 | } | 208 | } |
| 197 | 209 | ||
| 198 | static void __init exynos4_clocksource_init(void) | 210 | static void __init exynos4_clocksource_init(void) |
| 199 | { | 211 | { |
| 200 | exynos4_mct_frc_start(); | 212 | exynos4_mct_frc_start(); |
| 201 | 213 | ||
| 214 | exynos4_delay_timer.read_current_timer = &exynos4_read_current_timer; | ||
| 215 | exynos4_delay_timer.freq = clk_rate; | ||
| 216 | register_current_timer_delay(&exynos4_delay_timer); | ||
| 217 | |||
| 202 | if (clocksource_register_hz(&mct_frc, clk_rate)) | 218 | if (clocksource_register_hz(&mct_frc, clk_rate)) |
| 203 | panic("%s: can't register clocksource\n", mct_frc.name); | 219 | panic("%s: can't register clocksource\n", mct_frc.name); |
| 204 | 220 | ||
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index 738c8b7b17dc..db6d9a2fea4d 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile | |||
| @@ -49,7 +49,7 @@ obj-$(CONFIG_ARM_BIG_LITTLE_CPUFREQ) += arm_big_little.o | |||
| 49 | # LITTLE drivers, so that it is probed last. | 49 | # LITTLE drivers, so that it is probed last. |
| 50 | obj-$(CONFIG_ARM_DT_BL_CPUFREQ) += arm_big_little_dt.o | 50 | obj-$(CONFIG_ARM_DT_BL_CPUFREQ) += arm_big_little_dt.o |
| 51 | 51 | ||
| 52 | obj-$(CONFIG_ARCH_DAVINCI_DA850) += davinci-cpufreq.o | 52 | obj-$(CONFIG_ARCH_DAVINCI) += davinci-cpufreq.o |
| 53 | obj-$(CONFIG_UX500_SOC_DB8500) += dbx500-cpufreq.o | 53 | obj-$(CONFIG_UX500_SOC_DB8500) += dbx500-cpufreq.o |
| 54 | obj-$(CONFIG_ARM_EXYNOS_CPUFREQ) += exynos-cpufreq.o | 54 | obj-$(CONFIG_ARM_EXYNOS_CPUFREQ) += exynos-cpufreq.o |
| 55 | obj-$(CONFIG_ARM_EXYNOS4210_CPUFREQ) += exynos4210-cpufreq.o | 55 | obj-$(CONFIG_ARM_EXYNOS4210_CPUFREQ) += exynos4210-cpufreq.o |
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 924bb2d42b1c..86631cb6f7de 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
| @@ -128,6 +128,7 @@ static struct pstate_funcs pstate_funcs; | |||
| 128 | 128 | ||
| 129 | struct perf_limits { | 129 | struct perf_limits { |
| 130 | int no_turbo; | 130 | int no_turbo; |
| 131 | int turbo_disabled; | ||
| 131 | int max_perf_pct; | 132 | int max_perf_pct; |
| 132 | int min_perf_pct; | 133 | int min_perf_pct; |
| 133 | int32_t max_perf; | 134 | int32_t max_perf; |
| @@ -287,7 +288,10 @@ static ssize_t store_no_turbo(struct kobject *a, struct attribute *b, | |||
| 287 | if (ret != 1) | 288 | if (ret != 1) |
| 288 | return -EINVAL; | 289 | return -EINVAL; |
| 289 | limits.no_turbo = clamp_t(int, input, 0 , 1); | 290 | limits.no_turbo = clamp_t(int, input, 0 , 1); |
| 290 | 291 | if (limits.turbo_disabled) { | |
| 292 | pr_warn("Turbo disabled by BIOS or unavailable on processor\n"); | ||
| 293 | limits.no_turbo = limits.turbo_disabled; | ||
| 294 | } | ||
| 291 | return count; | 295 | return count; |
| 292 | } | 296 | } |
| 293 | 297 | ||
| @@ -357,21 +361,21 @@ static int byt_get_min_pstate(void) | |||
| 357 | { | 361 | { |
| 358 | u64 value; | 362 | u64 value; |
| 359 | rdmsrl(BYT_RATIOS, value); | 363 | rdmsrl(BYT_RATIOS, value); |
| 360 | return (value >> 8) & 0x3F; | 364 | return (value >> 8) & 0x7F; |
| 361 | } | 365 | } |
| 362 | 366 | ||
| 363 | static int byt_get_max_pstate(void) | 367 | static int byt_get_max_pstate(void) |
| 364 | { | 368 | { |
| 365 | u64 value; | 369 | u64 value; |
| 366 | rdmsrl(BYT_RATIOS, value); | 370 | rdmsrl(BYT_RATIOS, value); |
| 367 | return (value >> 16) & 0x3F; | 371 | return (value >> 16) & 0x7F; |
| 368 | } | 372 | } |
| 369 | 373 | ||
| 370 | static int byt_get_turbo_pstate(void) | 374 | static int byt_get_turbo_pstate(void) |
| 371 | { | 375 | { |
| 372 | u64 value; | 376 | u64 value; |
| 373 | rdmsrl(BYT_TURBO_RATIOS, value); | 377 | rdmsrl(BYT_TURBO_RATIOS, value); |
| 374 | return value & 0x3F; | 378 | return value & 0x7F; |
| 375 | } | 379 | } |
| 376 | 380 | ||
| 377 | static void byt_set_pstate(struct cpudata *cpudata, int pstate) | 381 | static void byt_set_pstate(struct cpudata *cpudata, int pstate) |
| @@ -381,7 +385,7 @@ static void byt_set_pstate(struct cpudata *cpudata, int pstate) | |||
| 381 | u32 vid; | 385 | u32 vid; |
| 382 | 386 | ||
| 383 | val = pstate << 8; | 387 | val = pstate << 8; |
| 384 | if (limits.no_turbo) | 388 | if (limits.no_turbo && !limits.turbo_disabled) |
| 385 | val |= (u64)1 << 32; | 389 | val |= (u64)1 << 32; |
| 386 | 390 | ||
| 387 | vid_fp = cpudata->vid.min + mul_fp( | 391 | vid_fp = cpudata->vid.min + mul_fp( |
| @@ -405,8 +409,8 @@ static void byt_get_vid(struct cpudata *cpudata) | |||
| 405 | 409 | ||
| 406 | 410 | ||
| 407 | rdmsrl(BYT_VIDS, value); | 411 | rdmsrl(BYT_VIDS, value); |
| 408 | cpudata->vid.min = int_tofp((value >> 8) & 0x3f); | 412 | cpudata->vid.min = int_tofp((value >> 8) & 0x7f); |
| 409 | cpudata->vid.max = int_tofp((value >> 16) & 0x3f); | 413 | cpudata->vid.max = int_tofp((value >> 16) & 0x7f); |
| 410 | cpudata->vid.ratio = div_fp( | 414 | cpudata->vid.ratio = div_fp( |
| 411 | cpudata->vid.max - cpudata->vid.min, | 415 | cpudata->vid.max - cpudata->vid.min, |
| 412 | int_tofp(cpudata->pstate.max_pstate - | 416 | int_tofp(cpudata->pstate.max_pstate - |
| @@ -448,7 +452,7 @@ static void core_set_pstate(struct cpudata *cpudata, int pstate) | |||
| 448 | u64 val; | 452 | u64 val; |
| 449 | 453 | ||
| 450 | val = pstate << 8; | 454 | val = pstate << 8; |
| 451 | if (limits.no_turbo) | 455 | if (limits.no_turbo && !limits.turbo_disabled) |
| 452 | val |= (u64)1 << 32; | 456 | val |= (u64)1 << 32; |
| 453 | 457 | ||
| 454 | wrmsrl_on_cpu(cpudata->cpu, MSR_IA32_PERF_CTL, val); | 458 | wrmsrl_on_cpu(cpudata->cpu, MSR_IA32_PERF_CTL, val); |
| @@ -696,9 +700,8 @@ static int intel_pstate_init_cpu(unsigned int cpunum) | |||
| 696 | 700 | ||
| 697 | cpu = all_cpu_data[cpunum]; | 701 | cpu = all_cpu_data[cpunum]; |
| 698 | 702 | ||
| 699 | intel_pstate_get_cpu_pstates(cpu); | ||
| 700 | |||
| 701 | cpu->cpu = cpunum; | 703 | cpu->cpu = cpunum; |
| 704 | intel_pstate_get_cpu_pstates(cpu); | ||
| 702 | 705 | ||
| 703 | init_timer_deferrable(&cpu->timer); | 706 | init_timer_deferrable(&cpu->timer); |
| 704 | cpu->timer.function = intel_pstate_timer_func; | 707 | cpu->timer.function = intel_pstate_timer_func; |
| @@ -741,7 +744,7 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) | |||
| 741 | limits.min_perf = int_tofp(1); | 744 | limits.min_perf = int_tofp(1); |
| 742 | limits.max_perf_pct = 100; | 745 | limits.max_perf_pct = 100; |
| 743 | limits.max_perf = int_tofp(1); | 746 | limits.max_perf = int_tofp(1); |
| 744 | limits.no_turbo = 0; | 747 | limits.no_turbo = limits.turbo_disabled; |
| 745 | return 0; | 748 | return 0; |
| 746 | } | 749 | } |
| 747 | limits.min_perf_pct = (policy->min * 100) / policy->cpuinfo.max_freq; | 750 | limits.min_perf_pct = (policy->min * 100) / policy->cpuinfo.max_freq; |
| @@ -784,6 +787,7 @@ static int intel_pstate_cpu_init(struct cpufreq_policy *policy) | |||
| 784 | { | 787 | { |
| 785 | struct cpudata *cpu; | 788 | struct cpudata *cpu; |
| 786 | int rc; | 789 | int rc; |
| 790 | u64 misc_en; | ||
| 787 | 791 | ||
| 788 | rc = intel_pstate_init_cpu(policy->cpu); | 792 | rc = intel_pstate_init_cpu(policy->cpu); |
| 789 | if (rc) | 793 | if (rc) |
| @@ -791,8 +795,13 @@ static int intel_pstate_cpu_init(struct cpufreq_policy *policy) | |||
| 791 | 795 | ||
| 792 | cpu = all_cpu_data[policy->cpu]; | 796 | cpu = all_cpu_data[policy->cpu]; |
| 793 | 797 | ||
| 794 | if (!limits.no_turbo && | 798 | rdmsrl(MSR_IA32_MISC_ENABLE, misc_en); |
| 795 | limits.min_perf_pct == 100 && limits.max_perf_pct == 100) | 799 | if (misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE || |
| 800 | cpu->pstate.max_pstate == cpu->pstate.turbo_pstate) { | ||
| 801 | limits.turbo_disabled = 1; | ||
| 802 | limits.no_turbo = 1; | ||
| 803 | } | ||
| 804 | if (limits.min_perf_pct == 100 && limits.max_perf_pct == 100) | ||
| 796 | policy->policy = CPUFREQ_POLICY_PERFORMANCE; | 805 | policy->policy = CPUFREQ_POLICY_PERFORMANCE; |
| 797 | else | 806 | else |
| 798 | policy->policy = CPUFREQ_POLICY_POWERSAVE; | 807 | policy->policy = CPUFREQ_POLICY_POWERSAVE; |
diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c index 1d80bd3636c5..b512a4ba7569 100644 --- a/drivers/crypto/caam/jr.c +++ b/drivers/crypto/caam/jr.c | |||
| @@ -453,8 +453,8 @@ static int caam_jr_probe(struct platform_device *pdev) | |||
| 453 | int error; | 453 | int error; |
| 454 | 454 | ||
| 455 | jrdev = &pdev->dev; | 455 | jrdev = &pdev->dev; |
| 456 | jrpriv = kmalloc(sizeof(struct caam_drv_private_jr), | 456 | jrpriv = devm_kmalloc(jrdev, sizeof(struct caam_drv_private_jr), |
| 457 | GFP_KERNEL); | 457 | GFP_KERNEL); |
| 458 | if (!jrpriv) | 458 | if (!jrpriv) |
| 459 | return -ENOMEM; | 459 | return -ENOMEM; |
| 460 | 460 | ||
| @@ -487,10 +487,8 @@ static int caam_jr_probe(struct platform_device *pdev) | |||
| 487 | 487 | ||
| 488 | /* Now do the platform independent part */ | 488 | /* Now do the platform independent part */ |
| 489 | error = caam_jr_init(jrdev); /* now turn on hardware */ | 489 | error = caam_jr_init(jrdev); /* now turn on hardware */ |
| 490 | if (error) { | 490 | if (error) |
| 491 | kfree(jrpriv); | ||
| 492 | return error; | 491 | return error; |
| 493 | } | ||
| 494 | 492 | ||
| 495 | jrpriv->dev = jrdev; | 493 | jrpriv->dev = jrdev; |
| 496 | spin_lock(&driver_data.jr_alloc_lock); | 494 | spin_lock(&driver_data.jr_alloc_lock); |
diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index d028f36ae655..8f8b0b608875 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c | |||
| @@ -86,6 +86,9 @@ | |||
| 86 | 86 | ||
| 87 | #define USBSS_IRQ_PD_COMP (1 << 2) | 87 | #define USBSS_IRQ_PD_COMP (1 << 2) |
| 88 | 88 | ||
| 89 | /* Packet Descriptor */ | ||
| 90 | #define PD2_ZERO_LENGTH (1 << 19) | ||
| 91 | |||
| 89 | struct cppi41_channel { | 92 | struct cppi41_channel { |
| 90 | struct dma_chan chan; | 93 | struct dma_chan chan; |
| 91 | struct dma_async_tx_descriptor txd; | 94 | struct dma_async_tx_descriptor txd; |
| @@ -307,7 +310,7 @@ static irqreturn_t cppi41_irq(int irq, void *data) | |||
| 307 | __iormb(); | 310 | __iormb(); |
| 308 | 311 | ||
| 309 | while (val) { | 312 | while (val) { |
| 310 | u32 desc; | 313 | u32 desc, len; |
| 311 | 314 | ||
| 312 | q_num = __fls(val); | 315 | q_num = __fls(val); |
| 313 | val &= ~(1 << q_num); | 316 | val &= ~(1 << q_num); |
| @@ -319,9 +322,13 @@ static irqreturn_t cppi41_irq(int irq, void *data) | |||
| 319 | q_num, desc); | 322 | q_num, desc); |
| 320 | continue; | 323 | continue; |
| 321 | } | 324 | } |
| 322 | c->residue = pd_trans_len(c->desc->pd6) - | ||
| 323 | pd_trans_len(c->desc->pd0); | ||
| 324 | 325 | ||
| 326 | if (c->desc->pd2 & PD2_ZERO_LENGTH) | ||
| 327 | len = 0; | ||
| 328 | else | ||
| 329 | len = pd_trans_len(c->desc->pd0); | ||
| 330 | |||
| 331 | c->residue = pd_trans_len(c->desc->pd6) - len; | ||
| 325 | dma_cookie_complete(&c->txd); | 332 | dma_cookie_complete(&c->txd); |
| 326 | c->txd.callback(c->txd.callback_param); | 333 | c->txd.callback(c->txd.callback_param); |
| 327 | } | 334 | } |
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 128714622bf5..14867e3ac8ff 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
| @@ -255,6 +255,7 @@ struct sdma_channel { | |||
| 255 | enum dma_slave_buswidth word_size; | 255 | enum dma_slave_buswidth word_size; |
| 256 | unsigned int buf_tail; | 256 | unsigned int buf_tail; |
| 257 | unsigned int num_bd; | 257 | unsigned int num_bd; |
| 258 | unsigned int period_len; | ||
| 258 | struct sdma_buffer_descriptor *bd; | 259 | struct sdma_buffer_descriptor *bd; |
| 259 | dma_addr_t bd_phys; | 260 | dma_addr_t bd_phys; |
| 260 | unsigned int pc_from_device, pc_to_device; | 261 | unsigned int pc_from_device, pc_to_device; |
| @@ -593,6 +594,12 @@ static void sdma_event_disable(struct sdma_channel *sdmac, unsigned int event) | |||
| 593 | 594 | ||
| 594 | static void sdma_handle_channel_loop(struct sdma_channel *sdmac) | 595 | static void sdma_handle_channel_loop(struct sdma_channel *sdmac) |
| 595 | { | 596 | { |
| 597 | if (sdmac->desc.callback) | ||
| 598 | sdmac->desc.callback(sdmac->desc.callback_param); | ||
| 599 | } | ||
| 600 | |||
| 601 | static void sdma_update_channel_loop(struct sdma_channel *sdmac) | ||
| 602 | { | ||
| 596 | struct sdma_buffer_descriptor *bd; | 603 | struct sdma_buffer_descriptor *bd; |
| 597 | 604 | ||
| 598 | /* | 605 | /* |
| @@ -611,9 +618,6 @@ static void sdma_handle_channel_loop(struct sdma_channel *sdmac) | |||
| 611 | bd->mode.status |= BD_DONE; | 618 | bd->mode.status |= BD_DONE; |
| 612 | sdmac->buf_tail++; | 619 | sdmac->buf_tail++; |
| 613 | sdmac->buf_tail %= sdmac->num_bd; | 620 | sdmac->buf_tail %= sdmac->num_bd; |
| 614 | |||
| 615 | if (sdmac->desc.callback) | ||
| 616 | sdmac->desc.callback(sdmac->desc.callback_param); | ||
| 617 | } | 621 | } |
| 618 | } | 622 | } |
| 619 | 623 | ||
| @@ -669,6 +673,9 @@ static irqreturn_t sdma_int_handler(int irq, void *dev_id) | |||
| 669 | int channel = fls(stat) - 1; | 673 | int channel = fls(stat) - 1; |
| 670 | struct sdma_channel *sdmac = &sdma->channel[channel]; | 674 | struct sdma_channel *sdmac = &sdma->channel[channel]; |
| 671 | 675 | ||
| 676 | if (sdmac->flags & IMX_DMA_SG_LOOP) | ||
| 677 | sdma_update_channel_loop(sdmac); | ||
| 678 | |||
| 672 | tasklet_schedule(&sdmac->tasklet); | 679 | tasklet_schedule(&sdmac->tasklet); |
| 673 | 680 | ||
| 674 | __clear_bit(channel, &stat); | 681 | __clear_bit(channel, &stat); |
| @@ -1129,6 +1136,7 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( | |||
| 1129 | sdmac->status = DMA_IN_PROGRESS; | 1136 | sdmac->status = DMA_IN_PROGRESS; |
| 1130 | 1137 | ||
| 1131 | sdmac->buf_tail = 0; | 1138 | sdmac->buf_tail = 0; |
| 1139 | sdmac->period_len = period_len; | ||
| 1132 | 1140 | ||
| 1133 | sdmac->flags |= IMX_DMA_SG_LOOP; | 1141 | sdmac->flags |= IMX_DMA_SG_LOOP; |
| 1134 | sdmac->direction = direction; | 1142 | sdmac->direction = direction; |
| @@ -1225,9 +1233,15 @@ static enum dma_status sdma_tx_status(struct dma_chan *chan, | |||
| 1225 | struct dma_tx_state *txstate) | 1233 | struct dma_tx_state *txstate) |
| 1226 | { | 1234 | { |
| 1227 | struct sdma_channel *sdmac = to_sdma_chan(chan); | 1235 | struct sdma_channel *sdmac = to_sdma_chan(chan); |
| 1236 | u32 residue; | ||
| 1237 | |||
| 1238 | if (sdmac->flags & IMX_DMA_SG_LOOP) | ||
| 1239 | residue = (sdmac->num_bd - sdmac->buf_tail) * sdmac->period_len; | ||
| 1240 | else | ||
| 1241 | residue = sdmac->chn_count - sdmac->chn_real_count; | ||
| 1228 | 1242 | ||
| 1229 | dma_set_tx_state(txstate, chan->completed_cookie, chan->cookie, | 1243 | dma_set_tx_state(txstate, chan->completed_cookie, chan->cookie, |
| 1230 | sdmac->chn_count - sdmac->chn_real_count); | 1244 | residue); |
| 1231 | 1245 | ||
| 1232 | return sdmac->status; | 1246 | return sdmac->status; |
| 1233 | } | 1247 | } |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 6c656392d67d..d44344140627 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
| @@ -1464,12 +1464,13 @@ static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv) | |||
| 1464 | #else | 1464 | #else |
| 1465 | static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv) | 1465 | static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv) |
| 1466 | { | 1466 | { |
| 1467 | int ret; | 1467 | int ret = 0; |
| 1468 | 1468 | ||
| 1469 | DRM_INFO("Replacing VGA console driver\n"); | 1469 | DRM_INFO("Replacing VGA console driver\n"); |
| 1470 | 1470 | ||
| 1471 | console_lock(); | 1471 | console_lock(); |
| 1472 | ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1); | 1472 | if (con_is_bound(&vga_con)) |
| 1473 | ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1); | ||
| 1473 | if (ret == 0) { | 1474 | if (ret == 0) { |
| 1474 | ret = do_unregister_con_driver(&vga_con); | 1475 | ret = do_unregister_con_driver(&vga_con); |
| 1475 | 1476 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a47fbf60b781..374f964323ad 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
| @@ -656,6 +656,7 @@ enum intel_sbi_destination { | |||
| 656 | #define QUIRK_PIPEA_FORCE (1<<0) | 656 | #define QUIRK_PIPEA_FORCE (1<<0) |
| 657 | #define QUIRK_LVDS_SSC_DISABLE (1<<1) | 657 | #define QUIRK_LVDS_SSC_DISABLE (1<<1) |
| 658 | #define QUIRK_INVERT_BRIGHTNESS (1<<2) | 658 | #define QUIRK_INVERT_BRIGHTNESS (1<<2) |
| 659 | #define QUIRK_BACKLIGHT_PRESENT (1<<3) | ||
| 659 | 660 | ||
| 660 | struct intel_fbdev; | 661 | struct intel_fbdev; |
| 661 | struct intel_fbc_work; | 662 | struct intel_fbc_work; |
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index 62ef55ba061c..7465ab0fd396 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c | |||
| @@ -74,6 +74,50 @@ static unsigned long i915_stolen_to_physical(struct drm_device *dev) | |||
| 74 | if (base == 0) | 74 | if (base == 0) |
| 75 | return 0; | 75 | return 0; |
| 76 | 76 | ||
| 77 | /* make sure we don't clobber the GTT if it's within stolen memory */ | ||
| 78 | if (INTEL_INFO(dev)->gen <= 4 && !IS_G33(dev) && !IS_G4X(dev)) { | ||
| 79 | struct { | ||
| 80 | u32 start, end; | ||
| 81 | } stolen[2] = { | ||
| 82 | { .start = base, .end = base + dev_priv->gtt.stolen_size, }, | ||
| 83 | { .start = base, .end = base + dev_priv->gtt.stolen_size, }, | ||
| 84 | }; | ||
| 85 | u64 gtt_start, gtt_end; | ||
| 86 | |||
| 87 | gtt_start = I915_READ(PGTBL_CTL); | ||
| 88 | if (IS_GEN4(dev)) | ||
| 89 | gtt_start = (gtt_start & PGTBL_ADDRESS_LO_MASK) | | ||
| 90 | (gtt_start & PGTBL_ADDRESS_HI_MASK) << 28; | ||
| 91 | else | ||
| 92 | gtt_start &= PGTBL_ADDRESS_LO_MASK; | ||
| 93 | gtt_end = gtt_start + gtt_total_entries(dev_priv->gtt) * 4; | ||
| 94 | |||
| 95 | if (gtt_start >= stolen[0].start && gtt_start < stolen[0].end) | ||
| 96 | stolen[0].end = gtt_start; | ||
| 97 | if (gtt_end > stolen[1].start && gtt_end <= stolen[1].end) | ||
| 98 | stolen[1].start = gtt_end; | ||
| 99 | |||
| 100 | /* pick the larger of the two chunks */ | ||
| 101 | if (stolen[0].end - stolen[0].start > | ||
| 102 | stolen[1].end - stolen[1].start) { | ||
| 103 | base = stolen[0].start; | ||
| 104 | dev_priv->gtt.stolen_size = stolen[0].end - stolen[0].start; | ||
| 105 | } else { | ||
| 106 | base = stolen[1].start; | ||
| 107 | dev_priv->gtt.stolen_size = stolen[1].end - stolen[1].start; | ||
| 108 | } | ||
| 109 | |||
| 110 | if (stolen[0].start != stolen[1].start || | ||
| 111 | stolen[0].end != stolen[1].end) { | ||
| 112 | DRM_DEBUG_KMS("GTT within stolen memory at 0x%llx-0x%llx\n", | ||
| 113 | (unsigned long long) gtt_start, | ||
| 114 | (unsigned long long) gtt_end - 1); | ||
| 115 | DRM_DEBUG_KMS("Stolen memory adjusted to 0x%x-0x%x\n", | ||
| 116 | base, base + (u32) dev_priv->gtt.stolen_size - 1); | ||
| 117 | } | ||
| 118 | } | ||
| 119 | |||
| 120 | |||
| 77 | /* Verify that nothing else uses this physical address. Stolen | 121 | /* Verify that nothing else uses this physical address. Stolen |
| 78 | * memory should be reserved by the BIOS and hidden from the | 122 | * memory should be reserved by the BIOS and hidden from the |
| 79 | * kernel. So if the region is already marked as busy, something | 123 | * kernel. So if the region is already marked as busy, something |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index e691b30b2817..a5bab61bfc00 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
| @@ -942,6 +942,9 @@ enum punit_power_well { | |||
| 942 | /* | 942 | /* |
| 943 | * Instruction and interrupt control regs | 943 | * Instruction and interrupt control regs |
| 944 | */ | 944 | */ |
| 945 | #define PGTBL_CTL 0x02020 | ||
| 946 | #define PGTBL_ADDRESS_LO_MASK 0xfffff000 /* bits [31:12] */ | ||
| 947 | #define PGTBL_ADDRESS_HI_MASK 0x000000f0 /* bits [35:32] (gen4) */ | ||
| 945 | #define PGTBL_ER 0x02024 | 948 | #define PGTBL_ER 0x02024 |
| 946 | #define RENDER_RING_BASE 0x02000 | 949 | #define RENDER_RING_BASE 0x02000 |
| 947 | #define BSD_RING_BASE 0x04000 | 950 | #define BSD_RING_BASE 0x04000 |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 556c916dbf9d..e27e7804c0b9 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -11591,6 +11591,14 @@ static void quirk_invert_brightness(struct drm_device *dev) | |||
| 11591 | DRM_INFO("applying inverted panel brightness quirk\n"); | 11591 | DRM_INFO("applying inverted panel brightness quirk\n"); |
| 11592 | } | 11592 | } |
| 11593 | 11593 | ||
| 11594 | /* Some VBT's incorrectly indicate no backlight is present */ | ||
| 11595 | static void quirk_backlight_present(struct drm_device *dev) | ||
| 11596 | { | ||
| 11597 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 11598 | dev_priv->quirks |= QUIRK_BACKLIGHT_PRESENT; | ||
| 11599 | DRM_INFO("applying backlight present quirk\n"); | ||
| 11600 | } | ||
| 11601 | |||
| 11594 | struct intel_quirk { | 11602 | struct intel_quirk { |
| 11595 | int device; | 11603 | int device; |
| 11596 | int subsystem_vendor; | 11604 | int subsystem_vendor; |
| @@ -11659,6 +11667,12 @@ static struct intel_quirk intel_quirks[] = { | |||
| 11659 | 11667 | ||
| 11660 | /* Acer Aspire 5336 */ | 11668 | /* Acer Aspire 5336 */ |
| 11661 | { 0x2a42, 0x1025, 0x048a, quirk_invert_brightness }, | 11669 | { 0x2a42, 0x1025, 0x048a, quirk_invert_brightness }, |
| 11670 | |||
| 11671 | /* Acer C720 and C720P Chromebooks (Celeron 2955U) have backlights */ | ||
| 11672 | { 0x0a06, 0x1025, 0x0a11, quirk_backlight_present }, | ||
| 11673 | |||
| 11674 | /* Toshiba CB35 Chromebook (Celeron 2955U) */ | ||
| 11675 | { 0x0a06, 0x1179, 0x0a88, quirk_backlight_present }, | ||
| 11662 | }; | 11676 | }; |
| 11663 | 11677 | ||
| 11664 | static void intel_init_quirks(struct drm_device *dev) | 11678 | static void intel_init_quirks(struct drm_device *dev) |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 52fda950fd2a..075170d1844f 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -28,6 +28,8 @@ | |||
| 28 | #include <linux/i2c.h> | 28 | #include <linux/i2c.h> |
| 29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
| 30 | #include <linux/export.h> | 30 | #include <linux/export.h> |
| 31 | #include <linux/notifier.h> | ||
| 32 | #include <linux/reboot.h> | ||
| 31 | #include <drm/drmP.h> | 33 | #include <drm/drmP.h> |
| 32 | #include <drm/drm_crtc.h> | 34 | #include <drm/drm_crtc.h> |
| 33 | #include <drm/drm_crtc_helper.h> | 35 | #include <drm/drm_crtc_helper.h> |
| @@ -336,6 +338,37 @@ static u32 _pp_stat_reg(struct intel_dp *intel_dp) | |||
| 336 | return VLV_PIPE_PP_STATUS(vlv_power_sequencer_pipe(intel_dp)); | 338 | return VLV_PIPE_PP_STATUS(vlv_power_sequencer_pipe(intel_dp)); |
| 337 | } | 339 | } |
| 338 | 340 | ||
| 341 | /* Reboot notifier handler to shutdown panel power to guarantee T12 timing | ||
| 342 | This function only applicable when panel PM state is not to be tracked */ | ||
| 343 | static int edp_notify_handler(struct notifier_block *this, unsigned long code, | ||
| 344 | void *unused) | ||
| 345 | { | ||
| 346 | struct intel_dp *intel_dp = container_of(this, typeof(* intel_dp), | ||
| 347 | edp_notifier); | ||
| 348 | struct drm_device *dev = intel_dp_to_dev(intel_dp); | ||
| 349 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 350 | u32 pp_div; | ||
| 351 | u32 pp_ctrl_reg, pp_div_reg; | ||
| 352 | enum pipe pipe = vlv_power_sequencer_pipe(intel_dp); | ||
| 353 | |||
| 354 | if (!is_edp(intel_dp) || code != SYS_RESTART) | ||
| 355 | return 0; | ||
| 356 | |||
| 357 | if (IS_VALLEYVIEW(dev)) { | ||
| 358 | pp_ctrl_reg = VLV_PIPE_PP_CONTROL(pipe); | ||
| 359 | pp_div_reg = VLV_PIPE_PP_DIVISOR(pipe); | ||
| 360 | pp_div = I915_READ(pp_div_reg); | ||
| 361 | pp_div &= PP_REFERENCE_DIVIDER_MASK; | ||
| 362 | |||
| 363 | /* 0x1F write to PP_DIV_REG sets max cycle delay */ | ||
| 364 | I915_WRITE(pp_div_reg, pp_div | 0x1F); | ||
| 365 | I915_WRITE(pp_ctrl_reg, PANEL_UNLOCK_REGS | PANEL_POWER_OFF); | ||
| 366 | msleep(intel_dp->panel_power_cycle_delay); | ||
| 367 | } | ||
| 368 | |||
| 369 | return 0; | ||
| 370 | } | ||
| 371 | |||
| 339 | static bool edp_have_panel_power(struct intel_dp *intel_dp) | 372 | static bool edp_have_panel_power(struct intel_dp *intel_dp) |
| 340 | { | 373 | { |
| 341 | struct drm_device *dev = intel_dp_to_dev(intel_dp); | 374 | struct drm_device *dev = intel_dp_to_dev(intel_dp); |
| @@ -3707,6 +3740,10 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder) | |||
| 3707 | drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); | 3740 | drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); |
| 3708 | edp_panel_vdd_off_sync(intel_dp); | 3741 | edp_panel_vdd_off_sync(intel_dp); |
| 3709 | drm_modeset_unlock(&dev->mode_config.connection_mutex); | 3742 | drm_modeset_unlock(&dev->mode_config.connection_mutex); |
| 3743 | if (intel_dp->edp_notifier.notifier_call) { | ||
| 3744 | unregister_reboot_notifier(&intel_dp->edp_notifier); | ||
| 3745 | intel_dp->edp_notifier.notifier_call = NULL; | ||
| 3746 | } | ||
| 3710 | } | 3747 | } |
| 3711 | kfree(intel_dig_port); | 3748 | kfree(intel_dig_port); |
| 3712 | } | 3749 | } |
| @@ -4184,6 +4221,11 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, | |||
| 4184 | } | 4221 | } |
| 4185 | mutex_unlock(&dev->mode_config.mutex); | 4222 | mutex_unlock(&dev->mode_config.mutex); |
| 4186 | 4223 | ||
| 4224 | if (IS_VALLEYVIEW(dev)) { | ||
| 4225 | intel_dp->edp_notifier.notifier_call = edp_notify_handler; | ||
| 4226 | register_reboot_notifier(&intel_dp->edp_notifier); | ||
| 4227 | } | ||
| 4228 | |||
| 4187 | intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode); | 4229 | intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode); |
| 4188 | intel_panel_setup_backlight(connector); | 4230 | intel_panel_setup_backlight(connector); |
| 4189 | 4231 | ||
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index eaa27ee9e367..f67340ed2c12 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
| @@ -538,6 +538,8 @@ struct intel_dp { | |||
| 538 | unsigned long last_power_on; | 538 | unsigned long last_power_on; |
| 539 | unsigned long last_backlight_off; | 539 | unsigned long last_backlight_off; |
| 540 | bool psr_setup_done; | 540 | bool psr_setup_done; |
| 541 | struct notifier_block edp_notifier; | ||
| 542 | |||
| 541 | bool use_tps3; | 543 | bool use_tps3; |
| 542 | struct intel_connector *attached_connector; | 544 | struct intel_connector *attached_connector; |
| 543 | 545 | ||
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c index 02f99d768d49..3fd082933c87 100644 --- a/drivers/gpu/drm/i915/intel_dsi.c +++ b/drivers/gpu/drm/i915/intel_dsi.c | |||
| @@ -117,17 +117,18 @@ static void intel_dsi_device_ready(struct intel_encoder *encoder) | |||
| 117 | /* bandgap reset is needed after everytime we do power gate */ | 117 | /* bandgap reset is needed after everytime we do power gate */ |
| 118 | band_gap_reset(dev_priv); | 118 | band_gap_reset(dev_priv); |
| 119 | 119 | ||
| 120 | I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_ENTER); | ||
| 121 | usleep_range(2500, 3000); | ||
| 122 | |||
| 120 | val = I915_READ(MIPI_PORT_CTRL(pipe)); | 123 | val = I915_READ(MIPI_PORT_CTRL(pipe)); |
| 121 | I915_WRITE(MIPI_PORT_CTRL(pipe), val | LP_OUTPUT_HOLD); | 124 | I915_WRITE(MIPI_PORT_CTRL(pipe), val | LP_OUTPUT_HOLD); |
| 122 | usleep_range(1000, 1500); | 125 | usleep_range(1000, 1500); |
| 123 | I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY | ULPS_STATE_EXIT); | 126 | |
| 124 | usleep_range(2000, 2500); | 127 | I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_EXIT); |
| 125 | I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY); | 128 | usleep_range(2500, 3000); |
| 126 | usleep_range(2000, 2500); | 129 | |
| 127 | I915_WRITE(MIPI_DEVICE_READY(pipe), 0x00); | ||
| 128 | usleep_range(2000, 2500); | ||
| 129 | I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY); | 130 | I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY); |
| 130 | usleep_range(2000, 2500); | 131 | usleep_range(2500, 3000); |
| 131 | } | 132 | } |
| 132 | 133 | ||
| 133 | static void intel_dsi_enable(struct intel_encoder *encoder) | 134 | static void intel_dsi_enable(struct intel_encoder *encoder) |
| @@ -271,23 +272,23 @@ static void intel_dsi_clear_device_ready(struct intel_encoder *encoder) | |||
| 271 | 272 | ||
| 272 | DRM_DEBUG_KMS("\n"); | 273 | DRM_DEBUG_KMS("\n"); |
| 273 | 274 | ||
| 274 | I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_ENTER); | 275 | I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY | ULPS_STATE_ENTER); |
| 275 | usleep_range(2000, 2500); | 276 | usleep_range(2000, 2500); |
| 276 | 277 | ||
| 277 | I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_EXIT); | 278 | I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY | ULPS_STATE_EXIT); |
| 278 | usleep_range(2000, 2500); | 279 | usleep_range(2000, 2500); |
| 279 | 280 | ||
| 280 | I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_ENTER); | 281 | I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY | ULPS_STATE_ENTER); |
| 281 | usleep_range(2000, 2500); | 282 | usleep_range(2000, 2500); |
| 282 | 283 | ||
| 283 | val = I915_READ(MIPI_PORT_CTRL(pipe)); | ||
| 284 | I915_WRITE(MIPI_PORT_CTRL(pipe), val & ~LP_OUTPUT_HOLD); | ||
| 285 | usleep_range(1000, 1500); | ||
| 286 | |||
| 287 | if (wait_for(((I915_READ(MIPI_PORT_CTRL(pipe)) & AFE_LATCHOUT) | 284 | if (wait_for(((I915_READ(MIPI_PORT_CTRL(pipe)) & AFE_LATCHOUT) |
| 288 | == 0x00000), 30)) | 285 | == 0x00000), 30)) |
| 289 | DRM_ERROR("DSI LP not going Low\n"); | 286 | DRM_ERROR("DSI LP not going Low\n"); |
| 290 | 287 | ||
| 288 | val = I915_READ(MIPI_PORT_CTRL(pipe)); | ||
| 289 | I915_WRITE(MIPI_PORT_CTRL(pipe), val & ~LP_OUTPUT_HOLD); | ||
| 290 | usleep_range(1000, 1500); | ||
| 291 | |||
| 291 | I915_WRITE(MIPI_DEVICE_READY(pipe), 0x00); | 292 | I915_WRITE(MIPI_DEVICE_READY(pipe), 0x00); |
| 292 | usleep_range(2000, 2500); | 293 | usleep_range(2000, 2500); |
| 293 | 294 | ||
diff --git a/drivers/gpu/drm/i915/intel_dsi_cmd.c b/drivers/gpu/drm/i915/intel_dsi_cmd.c index 3eeb21b9fddf..933c86305237 100644 --- a/drivers/gpu/drm/i915/intel_dsi_cmd.c +++ b/drivers/gpu/drm/i915/intel_dsi_cmd.c | |||
| @@ -404,12 +404,6 @@ int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs) | |||
| 404 | else | 404 | else |
| 405 | cmd |= DPI_LP_MODE; | 405 | cmd |= DPI_LP_MODE; |
| 406 | 406 | ||
| 407 | /* DPI virtual channel?! */ | ||
| 408 | |||
| 409 | mask = DPI_FIFO_EMPTY; | ||
| 410 | if (wait_for((I915_READ(MIPI_GEN_FIFO_STAT(pipe)) & mask) == mask, 50)) | ||
| 411 | DRM_ERROR("Timeout waiting for DPI FIFO empty.\n"); | ||
| 412 | |||
| 413 | /* clear bit */ | 407 | /* clear bit */ |
| 414 | I915_WRITE(MIPI_INTR_STAT(pipe), SPL_PKT_SENT_INTERRUPT); | 408 | I915_WRITE(MIPI_INTR_STAT(pipe), SPL_PKT_SENT_INTERRUPT); |
| 415 | 409 | ||
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c index 2e2c71fcc9ed..4f6b53998d79 100644 --- a/drivers/gpu/drm/i915/intel_opregion.c +++ b/drivers/gpu/drm/i915/intel_opregion.c | |||
| @@ -403,6 +403,15 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) | |||
| 403 | 403 | ||
| 404 | DRM_DEBUG_DRIVER("bclp = 0x%08x\n", bclp); | 404 | DRM_DEBUG_DRIVER("bclp = 0x%08x\n", bclp); |
| 405 | 405 | ||
| 406 | /* | ||
| 407 | * If the acpi_video interface is not supposed to be used, don't | ||
| 408 | * bother processing backlight level change requests from firmware. | ||
| 409 | */ | ||
| 410 | if (!acpi_video_verify_backlight_support()) { | ||
| 411 | DRM_DEBUG_KMS("opregion backlight request ignored\n"); | ||
| 412 | return 0; | ||
| 413 | } | ||
| 414 | |||
| 406 | if (!(bclp & ASLE_BCLP_VALID)) | 415 | if (!(bclp & ASLE_BCLP_VALID)) |
| 407 | return ASLC_BACKLIGHT_FAILED; | 416 | return ASLC_BACKLIGHT_FAILED; |
| 408 | 417 | ||
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 38a98570d10c..628cd8938274 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
| @@ -1118,8 +1118,12 @@ int intel_panel_setup_backlight(struct drm_connector *connector) | |||
| 1118 | int ret; | 1118 | int ret; |
| 1119 | 1119 | ||
| 1120 | if (!dev_priv->vbt.backlight.present) { | 1120 | if (!dev_priv->vbt.backlight.present) { |
| 1121 | DRM_DEBUG_KMS("native backlight control not available per VBT\n"); | 1121 | if (dev_priv->quirks & QUIRK_BACKLIGHT_PRESENT) { |
| 1122 | return 0; | 1122 | DRM_DEBUG_KMS("no backlight present per VBT, but present per quirk\n"); |
| 1123 | } else { | ||
| 1124 | DRM_DEBUG_KMS("no backlight present per VBT\n"); | ||
| 1125 | return 0; | ||
| 1126 | } | ||
| 1123 | } | 1127 | } |
| 1124 | 1128 | ||
| 1125 | /* set level and max in panel struct */ | 1129 | /* set level and max in panel struct */ |
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c index 26e962b7e702..2283c442a10d 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c | |||
| @@ -1516,11 +1516,11 @@ nv50_disp_intr_unk20_2(struct nv50_disp_priv *priv, int head) | |||
| 1516 | } | 1516 | } |
| 1517 | 1517 | ||
| 1518 | switch ((ctrl & 0x000f0000) >> 16) { | 1518 | switch ((ctrl & 0x000f0000) >> 16) { |
| 1519 | case 6: datarate = pclk * 30 / 8; break; | 1519 | case 6: datarate = pclk * 30; break; |
| 1520 | case 5: datarate = pclk * 24 / 8; break; | 1520 | case 5: datarate = pclk * 24; break; |
| 1521 | case 2: | 1521 | case 2: |
| 1522 | default: | 1522 | default: |
| 1523 | datarate = pclk * 18 / 8; | 1523 | datarate = pclk * 18; |
| 1524 | break; | 1524 | break; |
| 1525 | } | 1525 | } |
| 1526 | 1526 | ||
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c index 48aa38a87e3f..fa30d8196f35 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c | |||
| @@ -1159,11 +1159,11 @@ nvd0_disp_intr_unk2_2(struct nv50_disp_priv *priv, int head) | |||
| 1159 | if (outp->info.type == DCB_OUTPUT_DP) { | 1159 | if (outp->info.type == DCB_OUTPUT_DP) { |
| 1160 | u32 sync = nv_rd32(priv, 0x660404 + (head * 0x300)); | 1160 | u32 sync = nv_rd32(priv, 0x660404 + (head * 0x300)); |
| 1161 | switch ((sync & 0x000003c0) >> 6) { | 1161 | switch ((sync & 0x000003c0) >> 6) { |
| 1162 | case 6: pclk = pclk * 30 / 8; break; | 1162 | case 6: pclk = pclk * 30; break; |
| 1163 | case 5: pclk = pclk * 24 / 8; break; | 1163 | case 5: pclk = pclk * 24; break; |
| 1164 | case 2: | 1164 | case 2: |
| 1165 | default: | 1165 | default: |
| 1166 | pclk = pclk * 18 / 8; | 1166 | pclk = pclk * 18; |
| 1167 | break; | 1167 | break; |
| 1168 | } | 1168 | } |
| 1169 | 1169 | ||
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c b/drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c index 52c299c3d300..eb2d7789555d 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c | |||
| @@ -34,7 +34,7 @@ nvkm_output_dp_train(struct nvkm_output *base, u32 datarate, bool wait) | |||
| 34 | struct nvkm_output_dp *outp = (void *)base; | 34 | struct nvkm_output_dp *outp = (void *)base; |
| 35 | bool retrain = true; | 35 | bool retrain = true; |
| 36 | u8 link[2], stat[3]; | 36 | u8 link[2], stat[3]; |
| 37 | u32 rate; | 37 | u32 linkrate; |
| 38 | int ret, i; | 38 | int ret, i; |
| 39 | 39 | ||
| 40 | /* check that the link is trained at a high enough rate */ | 40 | /* check that the link is trained at a high enough rate */ |
| @@ -44,8 +44,10 @@ nvkm_output_dp_train(struct nvkm_output *base, u32 datarate, bool wait) | |||
| 44 | goto done; | 44 | goto done; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | rate = link[0] * 27000 * (link[1] & DPCD_LC01_LANE_COUNT_SET); | 47 | linkrate = link[0] * 27000 * (link[1] & DPCD_LC01_LANE_COUNT_SET); |
| 48 | if (rate < ((datarate / 8) * 10)) { | 48 | linkrate = (linkrate * 8) / 10; /* 8B/10B coding overhead */ |
| 49 | datarate = (datarate + 9) / 10; /* -> decakilobits */ | ||
| 50 | if (linkrate < datarate) { | ||
| 49 | DBG("link not trained at sufficient rate\n"); | 51 | DBG("link not trained at sufficient rate\n"); |
| 50 | goto done; | 52 | goto done; |
| 51 | } | 53 | } |
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c index e1832778e8b6..7a1ebdfa9e1b 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c | |||
| @@ -87,6 +87,7 @@ nv50_sor_mthd(struct nouveau_object *object, u32 mthd, void *args, u32 size) | |||
| 87 | struct nvkm_output_dp *outpdp = (void *)outp; | 87 | struct nvkm_output_dp *outpdp = (void *)outp; |
| 88 | switch (data) { | 88 | switch (data) { |
| 89 | case NV94_DISP_SOR_DP_PWR_STATE_OFF: | 89 | case NV94_DISP_SOR_DP_PWR_STATE_OFF: |
| 90 | nouveau_event_put(outpdp->irq); | ||
| 90 | ((struct nvkm_output_dp_impl *)nv_oclass(outp)) | 91 | ((struct nvkm_output_dp_impl *)nv_oclass(outp)) |
| 91 | ->lnk_pwr(outpdp, 0); | 92 | ->lnk_pwr(outpdp, 0); |
| 92 | atomic_set(&outpdp->lt.done, 0); | 93 | atomic_set(&outpdp->lt.done, 0); |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h b/drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h index 0f57fcfe0bbf..2af9cfd2c60f 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h | |||
| @@ -26,7 +26,7 @@ ramfuc_reg2(u32 addr1, u32 addr2) | |||
| 26 | }; | 26 | }; |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | static inline struct ramfuc_reg | 29 | static noinline struct ramfuc_reg |
| 30 | ramfuc_reg(u32 addr) | 30 | ramfuc_reg(u32 addr) |
| 31 | { | 31 | { |
| 32 | return ramfuc_reg2(addr, addr); | 32 | return ramfuc_reg2(addr, addr); |
| @@ -107,7 +107,7 @@ ramfuc_nsec(struct ramfuc *ram, u32 nsec) | |||
| 107 | 107 | ||
| 108 | #define ram_init(s,p) ramfuc_init(&(s)->base, (p)) | 108 | #define ram_init(s,p) ramfuc_init(&(s)->base, (p)) |
| 109 | #define ram_exec(s,e) ramfuc_exec(&(s)->base, (e)) | 109 | #define ram_exec(s,e) ramfuc_exec(&(s)->base, (e)) |
| 110 | #define ram_have(s,r) ((s)->r_##r.addr != 0x000000) | 110 | #define ram_have(s,r) ((s)->r_##r.addr[0] != 0x000000) |
| 111 | #define ram_rd32(s,r) ramfuc_rd32(&(s)->base, &(s)->r_##r) | 111 | #define ram_rd32(s,r) ramfuc_rd32(&(s)->base, &(s)->r_##r) |
| 112 | #define ram_wr32(s,r,d) ramfuc_wr32(&(s)->base, &(s)->r_##r, (d)) | 112 | #define ram_wr32(s,r,d) ramfuc_wr32(&(s)->base, &(s)->r_##r, (d)) |
| 113 | #define ram_nuke(s,r) ramfuc_nuke(&(s)->base, &(s)->r_##r) | 113 | #define ram_nuke(s,r) ramfuc_nuke(&(s)->base, &(s)->r_##r) |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c index 1ad3ea503133..c5b46e302319 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c | |||
| @@ -200,6 +200,7 @@ r1373f4_init(struct nve0_ramfuc *fuc) | |||
| 200 | /* (re)program mempll, if required */ | 200 | /* (re)program mempll, if required */ |
| 201 | if (ram->mode == 2) { | 201 | if (ram->mode == 2) { |
| 202 | ram_mask(fuc, 0x1373f4, 0x00010000, 0x00000000); | 202 | ram_mask(fuc, 0x1373f4, 0x00010000, 0x00000000); |
| 203 | ram_mask(fuc, 0x132000, 0x80000000, 0x80000000); | ||
| 203 | ram_mask(fuc, 0x132000, 0x00000001, 0x00000000); | 204 | ram_mask(fuc, 0x132000, 0x00000001, 0x00000000); |
| 204 | ram_mask(fuc, 0x132004, 0x103fffff, mcoef); | 205 | ram_mask(fuc, 0x132004, 0x103fffff, mcoef); |
| 205 | ram_mask(fuc, 0x132000, 0x00000001, 0x00000001); | 206 | ram_mask(fuc, 0x132000, 0x00000001, 0x00000001); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index ddd83756b9a2..5425ffe3931d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
| @@ -652,12 +652,12 @@ int nouveau_pmops_resume(struct device *dev) | |||
| 652 | ret = nouveau_do_resume(drm_dev); | 652 | ret = nouveau_do_resume(drm_dev); |
| 653 | if (ret) | 653 | if (ret) |
| 654 | return ret; | 654 | return ret; |
| 655 | if (drm_dev->mode_config.num_crtc) | ||
| 656 | nouveau_fbcon_set_suspend(drm_dev, 0); | ||
| 657 | 655 | ||
| 658 | nouveau_fbcon_zfill_all(drm_dev); | 656 | if (drm_dev->mode_config.num_crtc) { |
| 659 | if (drm_dev->mode_config.num_crtc) | ||
| 660 | nouveau_display_resume(drm_dev); | 657 | nouveau_display_resume(drm_dev); |
| 658 | nouveau_fbcon_set_suspend(drm_dev, 0); | ||
| 659 | } | ||
| 660 | |||
| 661 | return 0; | 661 | return 0; |
| 662 | } | 662 | } |
| 663 | 663 | ||
| @@ -683,11 +683,12 @@ static int nouveau_pmops_thaw(struct device *dev) | |||
| 683 | ret = nouveau_do_resume(drm_dev); | 683 | ret = nouveau_do_resume(drm_dev); |
| 684 | if (ret) | 684 | if (ret) |
| 685 | return ret; | 685 | return ret; |
| 686 | if (drm_dev->mode_config.num_crtc) | 686 | |
| 687 | nouveau_fbcon_set_suspend(drm_dev, 0); | 687 | if (drm_dev->mode_config.num_crtc) { |
| 688 | nouveau_fbcon_zfill_all(drm_dev); | ||
| 689 | if (drm_dev->mode_config.num_crtc) | ||
| 690 | nouveau_display_resume(drm_dev); | 688 | nouveau_display_resume(drm_dev); |
| 689 | nouveau_fbcon_set_suspend(drm_dev, 0); | ||
| 690 | } | ||
| 691 | |||
| 691 | return 0; | 692 | return 0; |
| 692 | } | 693 | } |
| 693 | 694 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 64a42cfd3717..191665ee7f52 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c | |||
| @@ -531,17 +531,10 @@ nouveau_fbcon_set_suspend(struct drm_device *dev, int state) | |||
| 531 | if (state == 1) | 531 | if (state == 1) |
| 532 | nouveau_fbcon_save_disable_accel(dev); | 532 | nouveau_fbcon_save_disable_accel(dev); |
| 533 | fb_set_suspend(drm->fbcon->helper.fbdev, state); | 533 | fb_set_suspend(drm->fbcon->helper.fbdev, state); |
| 534 | if (state == 0) | 534 | if (state == 0) { |
| 535 | nouveau_fbcon_restore_accel(dev); | 535 | nouveau_fbcon_restore_accel(dev); |
| 536 | nouveau_fbcon_zfill(dev, drm->fbcon); | ||
| 537 | } | ||
| 536 | console_unlock(); | 538 | console_unlock(); |
| 537 | } | 539 | } |
| 538 | } | 540 | } |
| 539 | |||
| 540 | void | ||
| 541 | nouveau_fbcon_zfill_all(struct drm_device *dev) | ||
| 542 | { | ||
| 543 | struct nouveau_drm *drm = nouveau_drm(dev); | ||
| 544 | if (drm->fbcon) { | ||
| 545 | nouveau_fbcon_zfill(dev, drm->fbcon); | ||
| 546 | } | ||
| 547 | } | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.h b/drivers/gpu/drm/nouveau/nouveau_fbcon.h index fdfc0c94fbcc..fcff797d2084 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.h +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.h | |||
| @@ -61,7 +61,6 @@ void nouveau_fbcon_gpu_lockup(struct fb_info *info); | |||
| 61 | int nouveau_fbcon_init(struct drm_device *dev); | 61 | int nouveau_fbcon_init(struct drm_device *dev); |
| 62 | void nouveau_fbcon_fini(struct drm_device *dev); | 62 | void nouveau_fbcon_fini(struct drm_device *dev); |
| 63 | void nouveau_fbcon_set_suspend(struct drm_device *dev, int state); | 63 | void nouveau_fbcon_set_suspend(struct drm_device *dev, int state); |
| 64 | void nouveau_fbcon_zfill_all(struct drm_device *dev); | ||
| 65 | void nouveau_fbcon_save_disable_accel(struct drm_device *dev); | 64 | void nouveau_fbcon_save_disable_accel(struct drm_device *dev); |
| 66 | void nouveau_fbcon_restore_accel(struct drm_device *dev); | 65 | void nouveau_fbcon_restore_accel(struct drm_device *dev); |
| 67 | 66 | ||
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index afdf607df3e6..4c534b7b04da 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
| @@ -1741,7 +1741,8 @@ nv50_sor_dpms(struct drm_encoder *encoder, int mode) | |||
| 1741 | } | 1741 | } |
| 1742 | } | 1742 | } |
| 1743 | 1743 | ||
| 1744 | mthd = (ffs(nv_encoder->dcb->sorconf.link) - 1) << 2; | 1744 | mthd = (ffs(nv_encoder->dcb->heads) - 1) << 3; |
| 1745 | mthd |= (ffs(nv_encoder->dcb->sorconf.link) - 1) << 2; | ||
| 1745 | mthd |= nv_encoder->or; | 1746 | mthd |= nv_encoder->or; |
| 1746 | 1747 | ||
| 1747 | if (nv_encoder->dcb->type == DCB_OUTPUT_DP) { | 1748 | if (nv_encoder->dcb->type == DCB_OUTPUT_DP) { |
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index 35f4182c63b6..b1e11f8434e2 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c | |||
| @@ -127,7 +127,7 @@ static int radeon_process_aux_ch(struct radeon_i2c_chan *chan, | |||
| 127 | /* flags not zero */ | 127 | /* flags not zero */ |
| 128 | if (args.v1.ucReplyStatus == 2) { | 128 | if (args.v1.ucReplyStatus == 2) { |
| 129 | DRM_DEBUG_KMS("dp_aux_ch flags not zero\n"); | 129 | DRM_DEBUG_KMS("dp_aux_ch flags not zero\n"); |
| 130 | r = -EBUSY; | 130 | r = -EIO; |
| 131 | goto done; | 131 | goto done; |
| 132 | } | 132 | } |
| 133 | 133 | ||
diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index 10dae4106c08..584090ac3eb9 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c | |||
| @@ -1179,7 +1179,7 @@ static int ci_stop_dpm(struct radeon_device *rdev) | |||
| 1179 | tmp &= ~GLOBAL_PWRMGT_EN; | 1179 | tmp &= ~GLOBAL_PWRMGT_EN; |
| 1180 | WREG32_SMC(GENERAL_PWRMGT, tmp); | 1180 | WREG32_SMC(GENERAL_PWRMGT, tmp); |
| 1181 | 1181 | ||
| 1182 | tmp = RREG32(SCLK_PWRMGT_CNTL); | 1182 | tmp = RREG32_SMC(SCLK_PWRMGT_CNTL); |
| 1183 | tmp &= ~DYNAMIC_PM_EN; | 1183 | tmp &= ~DYNAMIC_PM_EN; |
| 1184 | WREG32_SMC(SCLK_PWRMGT_CNTL, tmp); | 1184 | WREG32_SMC(SCLK_PWRMGT_CNTL, tmp); |
| 1185 | 1185 | ||
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index dcd4518a9b08..0b2471107137 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c | |||
| @@ -7676,14 +7676,16 @@ restart_ih: | |||
| 7676 | addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR); | 7676 | addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR); |
| 7677 | status = RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS); | 7677 | status = RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS); |
| 7678 | mc_client = RREG32(VM_CONTEXT1_PROTECTION_FAULT_MCCLIENT); | 7678 | mc_client = RREG32(VM_CONTEXT1_PROTECTION_FAULT_MCCLIENT); |
| 7679 | /* reset addr and status */ | ||
| 7680 | WREG32_P(VM_CONTEXT1_CNTL2, 1, ~1); | ||
| 7681 | if (addr == 0x0 && status == 0x0) | ||
| 7682 | break; | ||
| 7679 | dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data); | 7683 | dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data); |
| 7680 | dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n", | 7684 | dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n", |
| 7681 | addr); | 7685 | addr); |
| 7682 | dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", | 7686 | dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", |
| 7683 | status); | 7687 | status); |
| 7684 | cik_vm_decode_fault(rdev, status, addr, mc_client); | 7688 | cik_vm_decode_fault(rdev, status, addr, mc_client); |
| 7685 | /* reset addr and status */ | ||
| 7686 | WREG32_P(VM_CONTEXT1_CNTL2, 1, ~1); | ||
| 7687 | break; | 7689 | break; |
| 7688 | case 167: /* VCE */ | 7690 | case 167: /* VCE */ |
| 7689 | DRM_DEBUG("IH: VCE int: 0x%08x\n", src_data); | 7691 | DRM_DEBUG("IH: VCE int: 0x%08x\n", src_data); |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index e2f605224e8c..f7ece0ff431b 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
| @@ -189,7 +189,7 @@ static const u32 evergreen_golden_registers[] = | |||
| 189 | 0x8c1c, 0xffffffff, 0x00001010, | 189 | 0x8c1c, 0xffffffff, 0x00001010, |
| 190 | 0x28350, 0xffffffff, 0x00000000, | 190 | 0x28350, 0xffffffff, 0x00000000, |
| 191 | 0xa008, 0xffffffff, 0x00010000, | 191 | 0xa008, 0xffffffff, 0x00010000, |
| 192 | 0x5cc, 0xffffffff, 0x00000001, | 192 | 0x5c4, 0xffffffff, 0x00000001, |
| 193 | 0x9508, 0xffffffff, 0x00000002, | 193 | 0x9508, 0xffffffff, 0x00000002, |
| 194 | 0x913c, 0x0000000f, 0x0000000a | 194 | 0x913c, 0x0000000f, 0x0000000a |
| 195 | }; | 195 | }; |
| @@ -476,7 +476,7 @@ static const u32 cedar_golden_registers[] = | |||
| 476 | 0x8c1c, 0xffffffff, 0x00001010, | 476 | 0x8c1c, 0xffffffff, 0x00001010, |
| 477 | 0x28350, 0xffffffff, 0x00000000, | 477 | 0x28350, 0xffffffff, 0x00000000, |
| 478 | 0xa008, 0xffffffff, 0x00010000, | 478 | 0xa008, 0xffffffff, 0x00010000, |
| 479 | 0x5cc, 0xffffffff, 0x00000001, | 479 | 0x5c4, 0xffffffff, 0x00000001, |
| 480 | 0x9508, 0xffffffff, 0x00000002 | 480 | 0x9508, 0xffffffff, 0x00000002 |
| 481 | }; | 481 | }; |
| 482 | 482 | ||
| @@ -635,7 +635,7 @@ static const u32 juniper_mgcg_init[] = | |||
| 635 | static const u32 supersumo_golden_registers[] = | 635 | static const u32 supersumo_golden_registers[] = |
| 636 | { | 636 | { |
| 637 | 0x5eb4, 0xffffffff, 0x00000002, | 637 | 0x5eb4, 0xffffffff, 0x00000002, |
| 638 | 0x5cc, 0xffffffff, 0x00000001, | 638 | 0x5c4, 0xffffffff, 0x00000001, |
| 639 | 0x7030, 0xffffffff, 0x00000011, | 639 | 0x7030, 0xffffffff, 0x00000011, |
| 640 | 0x7c30, 0xffffffff, 0x00000011, | 640 | 0x7c30, 0xffffffff, 0x00000011, |
| 641 | 0x6104, 0x01000300, 0x00000000, | 641 | 0x6104, 0x01000300, 0x00000000, |
| @@ -719,7 +719,7 @@ static const u32 sumo_golden_registers[] = | |||
| 719 | static const u32 wrestler_golden_registers[] = | 719 | static const u32 wrestler_golden_registers[] = |
| 720 | { | 720 | { |
| 721 | 0x5eb4, 0xffffffff, 0x00000002, | 721 | 0x5eb4, 0xffffffff, 0x00000002, |
| 722 | 0x5cc, 0xffffffff, 0x00000001, | 722 | 0x5c4, 0xffffffff, 0x00000001, |
| 723 | 0x7030, 0xffffffff, 0x00000011, | 723 | 0x7030, 0xffffffff, 0x00000011, |
| 724 | 0x7c30, 0xffffffff, 0x00000011, | 724 | 0x7c30, 0xffffffff, 0x00000011, |
| 725 | 0x6104, 0x01000300, 0x00000000, | 725 | 0x6104, 0x01000300, 0x00000000, |
| @@ -5066,14 +5066,16 @@ restart_ih: | |||
| 5066 | case 147: | 5066 | case 147: |
| 5067 | addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR); | 5067 | addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR); |
| 5068 | status = RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS); | 5068 | status = RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS); |
| 5069 | /* reset addr and status */ | ||
| 5070 | WREG32_P(VM_CONTEXT1_CNTL2, 1, ~1); | ||
| 5071 | if (addr == 0x0 && status == 0x0) | ||
| 5072 | break; | ||
| 5069 | dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data); | 5073 | dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data); |
| 5070 | dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n", | 5074 | dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n", |
| 5071 | addr); | 5075 | addr); |
| 5072 | dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", | 5076 | dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", |
| 5073 | status); | 5077 | status); |
| 5074 | cayman_vm_decode_fault(rdev, status, addr); | 5078 | cayman_vm_decode_fault(rdev, status, addr); |
| 5075 | /* reset addr and status */ | ||
| 5076 | WREG32_P(VM_CONTEXT1_CNTL2, 1, ~1); | ||
| 5077 | break; | 5079 | break; |
| 5078 | case 176: /* CP_INT in ring buffer */ | 5080 | case 176: /* CP_INT in ring buffer */ |
| 5079 | case 177: /* CP_INT in IB1 */ | 5081 | case 177: /* CP_INT in IB1 */ |
diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c index da041a43d82e..3c76e1dcdf04 100644 --- a/drivers/gpu/drm/radeon/rv770_dpm.c +++ b/drivers/gpu/drm/radeon/rv770_dpm.c | |||
| @@ -2329,12 +2329,6 @@ void rv770_get_engine_memory_ss(struct radeon_device *rdev) | |||
| 2329 | pi->mclk_ss = radeon_atombios_get_asic_ss_info(rdev, &ss, | 2329 | pi->mclk_ss = radeon_atombios_get_asic_ss_info(rdev, &ss, |
| 2330 | ASIC_INTERNAL_MEMORY_SS, 0); | 2330 | ASIC_INTERNAL_MEMORY_SS, 0); |
| 2331 | 2331 | ||
| 2332 | /* disable ss, causes hangs on some cayman boards */ | ||
| 2333 | if (rdev->family == CHIP_CAYMAN) { | ||
| 2334 | pi->sclk_ss = false; | ||
| 2335 | pi->mclk_ss = false; | ||
| 2336 | } | ||
| 2337 | |||
| 2338 | if (pi->sclk_ss || pi->mclk_ss) | 2332 | if (pi->sclk_ss || pi->mclk_ss) |
| 2339 | pi->dynamic_ss = true; | 2333 | pi->dynamic_ss = true; |
| 2340 | else | 2334 | else |
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 730cee2c34cf..eba0225259a4 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
| @@ -6376,14 +6376,16 @@ restart_ih: | |||
| 6376 | case 147: | 6376 | case 147: |
| 6377 | addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR); | 6377 | addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR); |
| 6378 | status = RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS); | 6378 | status = RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS); |
| 6379 | /* reset addr and status */ | ||
| 6380 | WREG32_P(VM_CONTEXT1_CNTL2, 1, ~1); | ||
| 6381 | if (addr == 0x0 && status == 0x0) | ||
| 6382 | break; | ||
| 6379 | dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data); | 6383 | dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data); |
| 6380 | dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n", | 6384 | dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n", |
| 6381 | addr); | 6385 | addr); |
| 6382 | dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", | 6386 | dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", |
| 6383 | status); | 6387 | status); |
| 6384 | si_vm_decode_fault(rdev, status, addr); | 6388 | si_vm_decode_fault(rdev, status, addr); |
| 6385 | /* reset addr and status */ | ||
| 6386 | WREG32_P(VM_CONTEXT1_CNTL2, 1, ~1); | ||
| 6387 | break; | 6389 | break; |
| 6388 | case 176: /* RINGID0 CP_INT */ | 6390 | case 176: /* RINGID0 CP_INT */ |
| 6389 | radeon_fence_process(rdev, RADEON_RING_TYPE_GFX_INDEX); | 6391 | radeon_fence_process(rdev, RADEON_RING_TYPE_GFX_INDEX); |
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 800c8b60f7a2..5e79c6ad914f 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
| @@ -810,7 +810,7 @@ config HID_ZYDACRON | |||
| 810 | 810 | ||
| 811 | config HID_SENSOR_HUB | 811 | config HID_SENSOR_HUB |
| 812 | tristate "HID Sensors framework support" | 812 | tristate "HID Sensors framework support" |
| 813 | depends on HID | 813 | depends on HID && HAS_IOMEM |
| 814 | select MFD_CORE | 814 | select MFD_CORE |
| 815 | default n | 815 | default n |
| 816 | ---help--- | 816 | ---help--- |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 6d00bb9366fa..48b66bbffc94 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
| @@ -323,6 +323,7 @@ | |||
| 323 | 323 | ||
| 324 | #define USB_VENDOR_ID_ETURBOTOUCH 0x22b9 | 324 | #define USB_VENDOR_ID_ETURBOTOUCH 0x22b9 |
| 325 | #define USB_DEVICE_ID_ETURBOTOUCH 0x0006 | 325 | #define USB_DEVICE_ID_ETURBOTOUCH 0x0006 |
| 326 | #define USB_DEVICE_ID_ETURBOTOUCH_2968 0x2968 | ||
| 326 | 327 | ||
| 327 | #define USB_VENDOR_ID_EZKEY 0x0518 | 328 | #define USB_VENDOR_ID_EZKEY 0x0518 |
| 328 | #define USB_DEVICE_ID_BTC_8193 0x0002 | 329 | #define USB_DEVICE_ID_BTC_8193 0x0002 |
| @@ -715,6 +716,8 @@ | |||
| 715 | 716 | ||
| 716 | #define USB_VENDOR_ID_PENMOUNT 0x14e1 | 717 | #define USB_VENDOR_ID_PENMOUNT 0x14e1 |
| 717 | #define USB_DEVICE_ID_PENMOUNT_PCI 0x3500 | 718 | #define USB_DEVICE_ID_PENMOUNT_PCI 0x3500 |
| 719 | #define USB_DEVICE_ID_PENMOUNT_1610 0x1610 | ||
| 720 | #define USB_DEVICE_ID_PENMOUNT_1640 0x1640 | ||
| 718 | 721 | ||
| 719 | #define USB_VENDOR_ID_PETALYNX 0x18b1 | 722 | #define USB_VENDOR_ID_PETALYNX 0x18b1 |
| 720 | #define USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE 0x0037 | 723 | #define USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE 0x0037 |
diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c index 2451c7e5febd..578bbe65902b 100644 --- a/drivers/hid/hid-rmi.c +++ b/drivers/hid/hid-rmi.c | |||
| @@ -428,6 +428,7 @@ static int rmi_raw_event(struct hid_device *hdev, | |||
| 428 | return 0; | 428 | return 0; |
| 429 | } | 429 | } |
| 430 | 430 | ||
| 431 | #ifdef CONFIG_PM | ||
| 431 | static int rmi_post_reset(struct hid_device *hdev) | 432 | static int rmi_post_reset(struct hid_device *hdev) |
| 432 | { | 433 | { |
| 433 | return rmi_set_mode(hdev, RMI_MODE_ATTN_REPORTS); | 434 | return rmi_set_mode(hdev, RMI_MODE_ATTN_REPORTS); |
| @@ -437,6 +438,7 @@ static int rmi_post_resume(struct hid_device *hdev) | |||
| 437 | { | 438 | { |
| 438 | return rmi_set_mode(hdev, RMI_MODE_ATTN_REPORTS); | 439 | return rmi_set_mode(hdev, RMI_MODE_ATTN_REPORTS); |
| 439 | } | 440 | } |
| 441 | #endif /* CONFIG_PM */ | ||
| 440 | 442 | ||
| 441 | #define RMI4_MAX_PAGE 0xff | 443 | #define RMI4_MAX_PAGE 0xff |
| 442 | #define RMI4_PAGE_SIZE 0x0100 | 444 | #define RMI4_PAGE_SIZE 0x0100 |
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index a8d5c8faf8cf..e244e449cbba 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c | |||
| @@ -159,17 +159,18 @@ int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev, | |||
| 159 | { | 159 | { |
| 160 | struct hid_sensor_hub_callbacks_list *callback; | 160 | struct hid_sensor_hub_callbacks_list *callback; |
| 161 | struct sensor_hub_data *pdata = hid_get_drvdata(hsdev->hdev); | 161 | struct sensor_hub_data *pdata = hid_get_drvdata(hsdev->hdev); |
| 162 | unsigned long flags; | ||
| 162 | 163 | ||
| 163 | spin_lock(&pdata->dyn_callback_lock); | 164 | spin_lock_irqsave(&pdata->dyn_callback_lock, flags); |
| 164 | list_for_each_entry(callback, &pdata->dyn_callback_list, list) | 165 | list_for_each_entry(callback, &pdata->dyn_callback_list, list) |
| 165 | if (callback->usage_id == usage_id && | 166 | if (callback->usage_id == usage_id && |
| 166 | callback->hsdev == hsdev) { | 167 | callback->hsdev == hsdev) { |
| 167 | spin_unlock(&pdata->dyn_callback_lock); | 168 | spin_unlock_irqrestore(&pdata->dyn_callback_lock, flags); |
| 168 | return -EINVAL; | 169 | return -EINVAL; |
| 169 | } | 170 | } |
| 170 | callback = kzalloc(sizeof(*callback), GFP_ATOMIC); | 171 | callback = kzalloc(sizeof(*callback), GFP_ATOMIC); |
| 171 | if (!callback) { | 172 | if (!callback) { |
| 172 | spin_unlock(&pdata->dyn_callback_lock); | 173 | spin_unlock_irqrestore(&pdata->dyn_callback_lock, flags); |
| 173 | return -ENOMEM; | 174 | return -ENOMEM; |
| 174 | } | 175 | } |
| 175 | callback->hsdev = hsdev; | 176 | callback->hsdev = hsdev; |
| @@ -177,7 +178,7 @@ int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev, | |||
| 177 | callback->usage_id = usage_id; | 178 | callback->usage_id = usage_id; |
| 178 | callback->priv = NULL; | 179 | callback->priv = NULL; |
| 179 | list_add_tail(&callback->list, &pdata->dyn_callback_list); | 180 | list_add_tail(&callback->list, &pdata->dyn_callback_list); |
| 180 | spin_unlock(&pdata->dyn_callback_lock); | 181 | spin_unlock_irqrestore(&pdata->dyn_callback_lock, flags); |
| 181 | 182 | ||
| 182 | return 0; | 183 | return 0; |
| 183 | } | 184 | } |
| @@ -188,8 +189,9 @@ int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev, | |||
| 188 | { | 189 | { |
| 189 | struct hid_sensor_hub_callbacks_list *callback; | 190 | struct hid_sensor_hub_callbacks_list *callback; |
| 190 | struct sensor_hub_data *pdata = hid_get_drvdata(hsdev->hdev); | 191 | struct sensor_hub_data *pdata = hid_get_drvdata(hsdev->hdev); |
| 192 | unsigned long flags; | ||
| 191 | 193 | ||
| 192 | spin_lock(&pdata->dyn_callback_lock); | 194 | spin_lock_irqsave(&pdata->dyn_callback_lock, flags); |
| 193 | list_for_each_entry(callback, &pdata->dyn_callback_list, list) | 195 | list_for_each_entry(callback, &pdata->dyn_callback_list, list) |
| 194 | if (callback->usage_id == usage_id && | 196 | if (callback->usage_id == usage_id && |
| 195 | callback->hsdev == hsdev) { | 197 | callback->hsdev == hsdev) { |
| @@ -197,7 +199,7 @@ int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev, | |||
| 197 | kfree(callback); | 199 | kfree(callback); |
| 198 | break; | 200 | break; |
| 199 | } | 201 | } |
| 200 | spin_unlock(&pdata->dyn_callback_lock); | 202 | spin_unlock_irqrestore(&pdata->dyn_callback_lock, flags); |
| 201 | 203 | ||
| 202 | return 0; | 204 | return 0; |
| 203 | } | 205 | } |
| @@ -378,15 +380,16 @@ static int sensor_hub_suspend(struct hid_device *hdev, pm_message_t message) | |||
| 378 | { | 380 | { |
| 379 | struct sensor_hub_data *pdata = hid_get_drvdata(hdev); | 381 | struct sensor_hub_data *pdata = hid_get_drvdata(hdev); |
| 380 | struct hid_sensor_hub_callbacks_list *callback; | 382 | struct hid_sensor_hub_callbacks_list *callback; |
| 383 | unsigned long flags; | ||
| 381 | 384 | ||
| 382 | hid_dbg(hdev, " sensor_hub_suspend\n"); | 385 | hid_dbg(hdev, " sensor_hub_suspend\n"); |
| 383 | spin_lock(&pdata->dyn_callback_lock); | 386 | spin_lock_irqsave(&pdata->dyn_callback_lock, flags); |
| 384 | list_for_each_entry(callback, &pdata->dyn_callback_list, list) { | 387 | list_for_each_entry(callback, &pdata->dyn_callback_list, list) { |
| 385 | if (callback->usage_callback->suspend) | 388 | if (callback->usage_callback->suspend) |
| 386 | callback->usage_callback->suspend( | 389 | callback->usage_callback->suspend( |
| 387 | callback->hsdev, callback->priv); | 390 | callback->hsdev, callback->priv); |
| 388 | } | 391 | } |
| 389 | spin_unlock(&pdata->dyn_callback_lock); | 392 | spin_unlock_irqrestore(&pdata->dyn_callback_lock, flags); |
| 390 | 393 | ||
| 391 | return 0; | 394 | return 0; |
| 392 | } | 395 | } |
| @@ -395,15 +398,16 @@ static int sensor_hub_resume(struct hid_device *hdev) | |||
| 395 | { | 398 | { |
| 396 | struct sensor_hub_data *pdata = hid_get_drvdata(hdev); | 399 | struct sensor_hub_data *pdata = hid_get_drvdata(hdev); |
| 397 | struct hid_sensor_hub_callbacks_list *callback; | 400 | struct hid_sensor_hub_callbacks_list *callback; |
| 401 | unsigned long flags; | ||
| 398 | 402 | ||
| 399 | hid_dbg(hdev, " sensor_hub_resume\n"); | 403 | hid_dbg(hdev, " sensor_hub_resume\n"); |
| 400 | spin_lock(&pdata->dyn_callback_lock); | 404 | spin_lock_irqsave(&pdata->dyn_callback_lock, flags); |
| 401 | list_for_each_entry(callback, &pdata->dyn_callback_list, list) { | 405 | list_for_each_entry(callback, &pdata->dyn_callback_list, list) { |
| 402 | if (callback->usage_callback->resume) | 406 | if (callback->usage_callback->resume) |
| 403 | callback->usage_callback->resume( | 407 | callback->usage_callback->resume( |
| 404 | callback->hsdev, callback->priv); | 408 | callback->hsdev, callback->priv); |
| 405 | } | 409 | } |
| 406 | spin_unlock(&pdata->dyn_callback_lock); | 410 | spin_unlock_irqrestore(&pdata->dyn_callback_lock, flags); |
| 407 | 411 | ||
| 408 | return 0; | 412 | return 0; |
| 409 | } | 413 | } |
| @@ -632,6 +636,7 @@ static int sensor_hub_probe(struct hid_device *hdev, | |||
| 632 | if (name == NULL) { | 636 | if (name == NULL) { |
| 633 | hid_err(hdev, "Failed MFD device name\n"); | 637 | hid_err(hdev, "Failed MFD device name\n"); |
| 634 | ret = -ENOMEM; | 638 | ret = -ENOMEM; |
| 639 | kfree(hsdev); | ||
| 635 | goto err_no_mem; | 640 | goto err_no_mem; |
| 636 | } | 641 | } |
| 637 | sd->hid_sensor_hub_client_devs[ | 642 | sd->hid_sensor_hub_client_devs[ |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 59badc10a08c..31e6727cd009 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
| @@ -49,6 +49,7 @@ static const struct hid_blacklist { | |||
| 49 | 49 | ||
| 50 | { USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II, HID_QUIRK_MULTI_INPUT }, | 50 | { USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II, HID_QUIRK_MULTI_INPUT }, |
| 51 | { USB_VENDOR_ID_ETURBOTOUCH, USB_DEVICE_ID_ETURBOTOUCH, HID_QUIRK_MULTI_INPUT }, | 51 | { USB_VENDOR_ID_ETURBOTOUCH, USB_DEVICE_ID_ETURBOTOUCH, HID_QUIRK_MULTI_INPUT }, |
| 52 | { USB_VENDOR_ID_ETURBOTOUCH, USB_DEVICE_ID_ETURBOTOUCH_2968, HID_QUIRK_MULTI_INPUT }, | ||
| 52 | { USB_VENDOR_ID_GREENASIA, USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD, HID_QUIRK_MULTI_INPUT }, | 53 | { USB_VENDOR_ID_GREENASIA, USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD, HID_QUIRK_MULTI_INPUT }, |
| 53 | { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, | 54 | { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, |
| 54 | { USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII, HID_QUIRK_MULTI_INPUT }, | 55 | { USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII, HID_QUIRK_MULTI_INPUT }, |
| @@ -76,6 +77,8 @@ static const struct hid_blacklist { | |||
| 76 | { USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GX680R_LED_PANEL, HID_QUIRK_NO_INIT_REPORTS }, | 77 | { USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GX680R_LED_PANEL, HID_QUIRK_NO_INIT_REPORTS }, |
| 77 | { USB_VENDOR_ID_NEXIO, USB_DEVICE_ID_NEXIO_MULTITOUCH_PTI0750, HID_QUIRK_NO_INIT_REPORTS }, | 78 | { USB_VENDOR_ID_NEXIO, USB_DEVICE_ID_NEXIO_MULTITOUCH_PTI0750, HID_QUIRK_NO_INIT_REPORTS }, |
| 78 | { USB_VENDOR_ID_NOVATEK, USB_DEVICE_ID_NOVATEK_MOUSE, HID_QUIRK_NO_INIT_REPORTS }, | 79 | { USB_VENDOR_ID_NOVATEK, USB_DEVICE_ID_NOVATEK_MOUSE, HID_QUIRK_NO_INIT_REPORTS }, |
| 80 | { USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_1610, HID_QUIRK_NOGET }, | ||
| 81 | { USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_1640, HID_QUIRK_NOGET }, | ||
| 79 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS }, | 82 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS }, |
| 80 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS }, | 83 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS }, |
| 81 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS }, | 84 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS }, |
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index e84f4526eb36..ae22e3c1fc4c 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c | |||
| @@ -339,9 +339,13 @@ static void process_chn_event(u32 relid) | |||
| 339 | */ | 339 | */ |
| 340 | 340 | ||
| 341 | do { | 341 | do { |
| 342 | hv_begin_read(&channel->inbound); | 342 | if (read_state) |
| 343 | hv_begin_read(&channel->inbound); | ||
| 343 | channel->onchannel_callback(arg); | 344 | channel->onchannel_callback(arg); |
| 344 | bytes_to_read = hv_end_read(&channel->inbound); | 345 | if (read_state) |
| 346 | bytes_to_read = hv_end_read(&channel->inbound); | ||
| 347 | else | ||
| 348 | bytes_to_read = 0; | ||
| 345 | } while (read_state && (bytes_to_read != 0)); | 349 | } while (read_state && (bytes_to_read != 0)); |
| 346 | } else { | 350 | } else { |
| 347 | pr_err("no channel callback for relid - %u\n", relid); | 351 | pr_err("no channel callback for relid - %u\n", relid); |
diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c index ea852537307e..521c14625b3a 100644 --- a/drivers/hv/hv_kvp.c +++ b/drivers/hv/hv_kvp.c | |||
| @@ -127,6 +127,17 @@ kvp_work_func(struct work_struct *dummy) | |||
| 127 | kvp_respond_to_host(NULL, HV_E_FAIL); | 127 | kvp_respond_to_host(NULL, HV_E_FAIL); |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | static void poll_channel(struct vmbus_channel *channel) | ||
| 131 | { | ||
| 132 | if (channel->target_cpu != smp_processor_id()) | ||
| 133 | smp_call_function_single(channel->target_cpu, | ||
| 134 | hv_kvp_onchannelcallback, | ||
| 135 | channel, true); | ||
| 136 | else | ||
| 137 | hv_kvp_onchannelcallback(channel); | ||
| 138 | } | ||
| 139 | |||
| 140 | |||
| 130 | static int kvp_handle_handshake(struct hv_kvp_msg *msg) | 141 | static int kvp_handle_handshake(struct hv_kvp_msg *msg) |
| 131 | { | 142 | { |
| 132 | int ret = 1; | 143 | int ret = 1; |
| @@ -155,7 +166,7 @@ static int kvp_handle_handshake(struct hv_kvp_msg *msg) | |||
| 155 | kvp_register(dm_reg_value); | 166 | kvp_register(dm_reg_value); |
| 156 | kvp_transaction.active = false; | 167 | kvp_transaction.active = false; |
| 157 | if (kvp_transaction.kvp_context) | 168 | if (kvp_transaction.kvp_context) |
| 158 | hv_kvp_onchannelcallback(kvp_transaction.kvp_context); | 169 | poll_channel(kvp_transaction.kvp_context); |
| 159 | } | 170 | } |
| 160 | return ret; | 171 | return ret; |
| 161 | } | 172 | } |
| @@ -568,7 +579,7 @@ response_done: | |||
| 568 | 579 | ||
| 569 | vmbus_sendpacket(channel, recv_buffer, buf_len, req_id, | 580 | vmbus_sendpacket(channel, recv_buffer, buf_len, req_id, |
| 570 | VM_PKT_DATA_INBAND, 0); | 581 | VM_PKT_DATA_INBAND, 0); |
| 571 | 582 | poll_channel(channel); | |
| 572 | } | 583 | } |
| 573 | 584 | ||
| 574 | /* | 585 | /* |
| @@ -603,7 +614,7 @@ void hv_kvp_onchannelcallback(void *context) | |||
| 603 | return; | 614 | return; |
| 604 | } | 615 | } |
| 605 | 616 | ||
| 606 | vmbus_recvpacket(channel, recv_buffer, PAGE_SIZE * 2, &recvlen, | 617 | vmbus_recvpacket(channel, recv_buffer, PAGE_SIZE * 4, &recvlen, |
| 607 | &requestid); | 618 | &requestid); |
| 608 | 619 | ||
| 609 | if (recvlen > 0) { | 620 | if (recvlen > 0) { |
diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c index dd761806f0e8..3b9c9ef0deb8 100644 --- a/drivers/hv/hv_util.c +++ b/drivers/hv/hv_util.c | |||
| @@ -319,7 +319,7 @@ static int util_probe(struct hv_device *dev, | |||
| 319 | (struct hv_util_service *)dev_id->driver_data; | 319 | (struct hv_util_service *)dev_id->driver_data; |
| 320 | int ret; | 320 | int ret; |
| 321 | 321 | ||
| 322 | srv->recv_buffer = kmalloc(PAGE_SIZE * 2, GFP_KERNEL); | 322 | srv->recv_buffer = kmalloc(PAGE_SIZE * 4, GFP_KERNEL); |
| 323 | if (!srv->recv_buffer) | 323 | if (!srv->recv_buffer) |
| 324 | return -ENOMEM; | 324 | return -ENOMEM; |
| 325 | if (srv->util_init) { | 325 | if (srv->util_init) { |
diff --git a/drivers/hwmon/adc128d818.c b/drivers/hwmon/adc128d818.c index 5ffd81f19d01..0625e50d7a6e 100644 --- a/drivers/hwmon/adc128d818.c +++ b/drivers/hwmon/adc128d818.c | |||
| @@ -239,50 +239,50 @@ static ssize_t adc128_show_alarm(struct device *dev, | |||
| 239 | return sprintf(buf, "%u\n", !!(alarms & mask)); | 239 | return sprintf(buf, "%u\n", !!(alarms & mask)); |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | static SENSOR_DEVICE_ATTR_2(in0_input, S_IWUSR | S_IRUGO, | 242 | static SENSOR_DEVICE_ATTR_2(in0_input, S_IRUGO, |
| 243 | adc128_show_in, adc128_set_in, 0, 0); | 243 | adc128_show_in, NULL, 0, 0); |
| 244 | static SENSOR_DEVICE_ATTR_2(in0_min, S_IWUSR | S_IRUGO, | 244 | static SENSOR_DEVICE_ATTR_2(in0_min, S_IWUSR | S_IRUGO, |
| 245 | adc128_show_in, adc128_set_in, 0, 1); | 245 | adc128_show_in, adc128_set_in, 0, 1); |
| 246 | static SENSOR_DEVICE_ATTR_2(in0_max, S_IWUSR | S_IRUGO, | 246 | static SENSOR_DEVICE_ATTR_2(in0_max, S_IWUSR | S_IRUGO, |
| 247 | adc128_show_in, adc128_set_in, 0, 2); | 247 | adc128_show_in, adc128_set_in, 0, 2); |
| 248 | 248 | ||
| 249 | static SENSOR_DEVICE_ATTR_2(in1_input, S_IWUSR | S_IRUGO, | 249 | static SENSOR_DEVICE_ATTR_2(in1_input, S_IRUGO, |
| 250 | adc128_show_in, adc128_set_in, 1, 0); | 250 | adc128_show_in, NULL, 1, 0); |
| 251 | static SENSOR_DEVICE_ATTR_2(in1_min, S_IWUSR | S_IRUGO, | 251 | static SENSOR_DEVICE_ATTR_2(in1_min, S_IWUSR | S_IRUGO, |
| 252 | adc128_show_in, adc128_set_in, 1, 1); | 252 | adc128_show_in, adc128_set_in, 1, 1); |
| 253 | static SENSOR_DEVICE_ATTR_2(in1_max, S_IWUSR | S_IRUGO, | 253 | static SENSOR_DEVICE_ATTR_2(in1_max, S_IWUSR | S_IRUGO, |
| 254 | adc128_show_in, adc128_set_in, 1, 2); | 254 | adc128_show_in, adc128_set_in, 1, 2); |
| 255 | 255 | ||
| 256 | static SENSOR_DEVICE_ATTR_2(in2_input, S_IWUSR | S_IRUGO, | 256 | static SENSOR_DEVICE_ATTR_2(in2_input, S_IRUGO, |
| 257 | adc128_show_in, adc128_set_in, 2, 0); | 257 | adc128_show_in, NULL, 2, 0); |
| 258 | static SENSOR_DEVICE_ATTR_2(in2_min, S_IWUSR | S_IRUGO, | 258 | static SENSOR_DEVICE_ATTR_2(in2_min, S_IWUSR | S_IRUGO, |
| 259 | adc128_show_in, adc128_set_in, 2, 1); | 259 | adc128_show_in, adc128_set_in, 2, 1); |
| 260 | static SENSOR_DEVICE_ATTR_2(in2_max, S_IWUSR | S_IRUGO, | 260 | static SENSOR_DEVICE_ATTR_2(in2_max, S_IWUSR | S_IRUGO, |
| 261 | adc128_show_in, adc128_set_in, 2, 2); | 261 | adc128_show_in, adc128_set_in, 2, 2); |
| 262 | 262 | ||
| 263 | static SENSOR_DEVICE_ATTR_2(in3_input, S_IWUSR | S_IRUGO, | 263 | static SENSOR_DEVICE_ATTR_2(in3_input, S_IRUGO, |
| 264 | adc128_show_in, adc128_set_in, 3, 0); | 264 | adc128_show_in, NULL, 3, 0); |
| 265 | static SENSOR_DEVICE_ATTR_2(in3_min, S_IWUSR | S_IRUGO, | 265 | static SENSOR_DEVICE_ATTR_2(in3_min, S_IWUSR | S_IRUGO, |
| 266 | adc128_show_in, adc128_set_in, 3, 1); | 266 | adc128_show_in, adc128_set_in, 3, 1); |
| 267 | static SENSOR_DEVICE_ATTR_2(in3_max, S_IWUSR | S_IRUGO, | 267 | static SENSOR_DEVICE_ATTR_2(in3_max, S_IWUSR | S_IRUGO, |
| 268 | adc128_show_in, adc128_set_in, 3, 2); | 268 | adc128_show_in, adc128_set_in, 3, 2); |
| 269 | 269 | ||
| 270 | static SENSOR_DEVICE_ATTR_2(in4_input, S_IWUSR | S_IRUGO, | 270 | static SENSOR_DEVICE_ATTR_2(in4_input, S_IRUGO, |
| 271 | adc128_show_in, adc128_set_in, 4, 0); | 271 | adc128_show_in, NULL, 4, 0); |
| 272 | static SENSOR_DEVICE_ATTR_2(in4_min, S_IWUSR | S_IRUGO, | 272 | static SENSOR_DEVICE_ATTR_2(in4_min, S_IWUSR | S_IRUGO, |
| 273 | adc128_show_in, adc128_set_in, 4, 1); | 273 | adc128_show_in, adc128_set_in, 4, 1); |
| 274 | static SENSOR_DEVICE_ATTR_2(in4_max, S_IWUSR | S_IRUGO, | 274 | static SENSOR_DEVICE_ATTR_2(in4_max, S_IWUSR | S_IRUGO, |
| 275 | adc128_show_in, adc128_set_in, 4, 2); | 275 | adc128_show_in, adc128_set_in, 4, 2); |
| 276 | 276 | ||
| 277 | static SENSOR_DEVICE_ATTR_2(in5_input, S_IWUSR | S_IRUGO, | 277 | static SENSOR_DEVICE_ATTR_2(in5_input, S_IRUGO, |
| 278 | adc128_show_in, adc128_set_in, 5, 0); | 278 | adc128_show_in, NULL, 5, 0); |
| 279 | static SENSOR_DEVICE_ATTR_2(in5_min, S_IWUSR | S_IRUGO, | 279 | static SENSOR_DEVICE_ATTR_2(in5_min, S_IWUSR | S_IRUGO, |
| 280 | adc128_show_in, adc128_set_in, 5, 1); | 280 | adc128_show_in, adc128_set_in, 5, 1); |
| 281 | static SENSOR_DEVICE_ATTR_2(in5_max, S_IWUSR | S_IRUGO, | 281 | static SENSOR_DEVICE_ATTR_2(in5_max, S_IWUSR | S_IRUGO, |
| 282 | adc128_show_in, adc128_set_in, 5, 2); | 282 | adc128_show_in, adc128_set_in, 5, 2); |
| 283 | 283 | ||
| 284 | static SENSOR_DEVICE_ATTR_2(in6_input, S_IWUSR | S_IRUGO, | 284 | static SENSOR_DEVICE_ATTR_2(in6_input, S_IRUGO, |
| 285 | adc128_show_in, adc128_set_in, 6, 0); | 285 | adc128_show_in, NULL, 6, 0); |
| 286 | static SENSOR_DEVICE_ATTR_2(in6_min, S_IWUSR | S_IRUGO, | 286 | static SENSOR_DEVICE_ATTR_2(in6_min, S_IWUSR | S_IRUGO, |
| 287 | adc128_show_in, adc128_set_in, 6, 1); | 287 | adc128_show_in, adc128_set_in, 6, 1); |
| 288 | static SENSOR_DEVICE_ATTR_2(in6_max, S_IWUSR | S_IRUGO, | 288 | static SENSOR_DEVICE_ATTR_2(in6_max, S_IWUSR | S_IRUGO, |
diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c index 3eb4281689b5..d74241bb278c 100644 --- a/drivers/hwmon/adm1021.c +++ b/drivers/hwmon/adm1021.c | |||
| @@ -185,7 +185,7 @@ static ssize_t set_temp_max(struct device *dev, | |||
| 185 | struct adm1021_data *data = dev_get_drvdata(dev); | 185 | struct adm1021_data *data = dev_get_drvdata(dev); |
| 186 | struct i2c_client *client = data->client; | 186 | struct i2c_client *client = data->client; |
| 187 | long temp; | 187 | long temp; |
| 188 | int err; | 188 | int reg_val, err; |
| 189 | 189 | ||
| 190 | err = kstrtol(buf, 10, &temp); | 190 | err = kstrtol(buf, 10, &temp); |
| 191 | if (err) | 191 | if (err) |
| @@ -193,10 +193,11 @@ static ssize_t set_temp_max(struct device *dev, | |||
| 193 | temp /= 1000; | 193 | temp /= 1000; |
| 194 | 194 | ||
| 195 | mutex_lock(&data->update_lock); | 195 | mutex_lock(&data->update_lock); |
| 196 | data->temp_max[index] = clamp_val(temp, -128, 127); | 196 | reg_val = clamp_val(temp, -128, 127); |
| 197 | data->temp_max[index] = reg_val * 1000; | ||
| 197 | if (!read_only) | 198 | if (!read_only) |
| 198 | i2c_smbus_write_byte_data(client, ADM1021_REG_TOS_W(index), | 199 | i2c_smbus_write_byte_data(client, ADM1021_REG_TOS_W(index), |
| 199 | data->temp_max[index]); | 200 | reg_val); |
| 200 | mutex_unlock(&data->update_lock); | 201 | mutex_unlock(&data->update_lock); |
| 201 | 202 | ||
| 202 | return count; | 203 | return count; |
| @@ -210,7 +211,7 @@ static ssize_t set_temp_min(struct device *dev, | |||
| 210 | struct adm1021_data *data = dev_get_drvdata(dev); | 211 | struct adm1021_data *data = dev_get_drvdata(dev); |
| 211 | struct i2c_client *client = data->client; | 212 | struct i2c_client *client = data->client; |
| 212 | long temp; | 213 | long temp; |
| 213 | int err; | 214 | int reg_val, err; |
| 214 | 215 | ||
| 215 | err = kstrtol(buf, 10, &temp); | 216 | err = kstrtol(buf, 10, &temp); |
| 216 | if (err) | 217 | if (err) |
| @@ -218,10 +219,11 @@ static ssize_t set_temp_min(struct device *dev, | |||
| 218 | temp /= 1000; | 219 | temp /= 1000; |
| 219 | 220 | ||
| 220 | mutex_lock(&data->update_lock); | 221 | mutex_lock(&data->update_lock); |
| 221 | data->temp_min[index] = clamp_val(temp, -128, 127); | 222 | reg_val = clamp_val(temp, -128, 127); |
| 223 | data->temp_min[index] = reg_val * 1000; | ||
| 222 | if (!read_only) | 224 | if (!read_only) |
| 223 | i2c_smbus_write_byte_data(client, ADM1021_REG_THYST_W(index), | 225 | i2c_smbus_write_byte_data(client, ADM1021_REG_THYST_W(index), |
| 224 | data->temp_min[index]); | 226 | reg_val); |
| 225 | mutex_unlock(&data->update_lock); | 227 | mutex_unlock(&data->update_lock); |
| 226 | 228 | ||
| 227 | return count; | 229 | return count; |
diff --git a/drivers/hwmon/adm1029.c b/drivers/hwmon/adm1029.c index 78339e880bd6..2804571b269e 100644 --- a/drivers/hwmon/adm1029.c +++ b/drivers/hwmon/adm1029.c | |||
| @@ -232,6 +232,9 @@ static ssize_t set_fan_div(struct device *dev, | |||
| 232 | /* Update the value */ | 232 | /* Update the value */ |
| 233 | reg = (reg & 0x3F) | (val << 6); | 233 | reg = (reg & 0x3F) | (val << 6); |
| 234 | 234 | ||
| 235 | /* Update the cache */ | ||
| 236 | data->fan_div[attr->index] = reg; | ||
| 237 | |||
| 235 | /* Write value */ | 238 | /* Write value */ |
| 236 | i2c_smbus_write_byte_data(client, | 239 | i2c_smbus_write_byte_data(client, |
| 237 | ADM1029_REG_FAN_DIV[attr->index], reg); | 240 | ADM1029_REG_FAN_DIV[attr->index], reg); |
diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c index a8a540ca8c34..51c1a5a165ab 100644 --- a/drivers/hwmon/adm1031.c +++ b/drivers/hwmon/adm1031.c | |||
| @@ -365,6 +365,7 @@ set_auto_temp_min(struct device *dev, struct device_attribute *attr, | |||
| 365 | if (ret) | 365 | if (ret) |
| 366 | return ret; | 366 | return ret; |
| 367 | 367 | ||
| 368 | val = clamp_val(val, 0, 127000); | ||
| 368 | mutex_lock(&data->update_lock); | 369 | mutex_lock(&data->update_lock); |
| 369 | data->auto_temp[nr] = AUTO_TEMP_MIN_TO_REG(val, data->auto_temp[nr]); | 370 | data->auto_temp[nr] = AUTO_TEMP_MIN_TO_REG(val, data->auto_temp[nr]); |
| 370 | adm1031_write_value(client, ADM1031_REG_AUTO_TEMP(nr), | 371 | adm1031_write_value(client, ADM1031_REG_AUTO_TEMP(nr), |
| @@ -394,6 +395,7 @@ set_auto_temp_max(struct device *dev, struct device_attribute *attr, | |||
| 394 | if (ret) | 395 | if (ret) |
| 395 | return ret; | 396 | return ret; |
| 396 | 397 | ||
| 398 | val = clamp_val(val, 0, 127000); | ||
| 397 | mutex_lock(&data->update_lock); | 399 | mutex_lock(&data->update_lock); |
| 398 | data->temp_max[nr] = AUTO_TEMP_MAX_TO_REG(val, data->auto_temp[nr], | 400 | data->temp_max[nr] = AUTO_TEMP_MAX_TO_REG(val, data->auto_temp[nr], |
| 399 | data->pwm[nr]); | 401 | data->pwm[nr]); |
| @@ -696,7 +698,7 @@ static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr, | |||
| 696 | if (ret) | 698 | if (ret) |
| 697 | return ret; | 699 | return ret; |
| 698 | 700 | ||
| 699 | val = clamp_val(val, -55000, nr == 0 ? 127750 : 127875); | 701 | val = clamp_val(val, -55000, 127000); |
| 700 | mutex_lock(&data->update_lock); | 702 | mutex_lock(&data->update_lock); |
| 701 | data->temp_min[nr] = TEMP_TO_REG(val); | 703 | data->temp_min[nr] = TEMP_TO_REG(val); |
| 702 | adm1031_write_value(client, ADM1031_REG_TEMP_MIN(nr), | 704 | adm1031_write_value(client, ADM1031_REG_TEMP_MIN(nr), |
| @@ -717,7 +719,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr, | |||
| 717 | if (ret) | 719 | if (ret) |
| 718 | return ret; | 720 | return ret; |
| 719 | 721 | ||
| 720 | val = clamp_val(val, -55000, nr == 0 ? 127750 : 127875); | 722 | val = clamp_val(val, -55000, 127000); |
| 721 | mutex_lock(&data->update_lock); | 723 | mutex_lock(&data->update_lock); |
| 722 | data->temp_max[nr] = TEMP_TO_REG(val); | 724 | data->temp_max[nr] = TEMP_TO_REG(val); |
| 723 | adm1031_write_value(client, ADM1031_REG_TEMP_MAX(nr), | 725 | adm1031_write_value(client, ADM1031_REG_TEMP_MAX(nr), |
| @@ -738,7 +740,7 @@ static ssize_t set_temp_crit(struct device *dev, struct device_attribute *attr, | |||
| 738 | if (ret) | 740 | if (ret) |
| 739 | return ret; | 741 | return ret; |
| 740 | 742 | ||
| 741 | val = clamp_val(val, -55000, nr == 0 ? 127750 : 127875); | 743 | val = clamp_val(val, -55000, 127000); |
| 742 | mutex_lock(&data->update_lock); | 744 | mutex_lock(&data->update_lock); |
| 743 | data->temp_crit[nr] = TEMP_TO_REG(val); | 745 | data->temp_crit[nr] = TEMP_TO_REG(val); |
| 744 | adm1031_write_value(client, ADM1031_REG_TEMP_CRIT(nr), | 746 | adm1031_write_value(client, ADM1031_REG_TEMP_CRIT(nr), |
diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c index eea817296513..9f2be3dd28f3 100644 --- a/drivers/hwmon/amc6821.c +++ b/drivers/hwmon/amc6821.c | |||
| @@ -704,7 +704,7 @@ static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, | |||
| 704 | get_temp_alarm, NULL, IDX_TEMP1_MAX); | 704 | get_temp_alarm, NULL, IDX_TEMP1_MAX); |
| 705 | static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, | 705 | static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, |
| 706 | get_temp_alarm, NULL, IDX_TEMP1_CRIT); | 706 | get_temp_alarm, NULL, IDX_TEMP1_CRIT); |
| 707 | static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO | S_IWUSR, | 707 | static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, |
| 708 | get_temp, NULL, IDX_TEMP2_INPUT); | 708 | get_temp, NULL, IDX_TEMP2_INPUT); |
| 709 | static SENSOR_DEVICE_ATTR(temp2_min, S_IRUGO | S_IWUSR, get_temp, | 709 | static SENSOR_DEVICE_ATTR(temp2_min, S_IRUGO | S_IWUSR, get_temp, |
| 710 | set_temp, IDX_TEMP2_MIN); | 710 | set_temp, IDX_TEMP2_MIN); |
diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c index fd892dd48e4c..78002de46cb6 100644 --- a/drivers/hwmon/emc2103.c +++ b/drivers/hwmon/emc2103.c | |||
| @@ -250,9 +250,7 @@ static ssize_t set_temp_min(struct device *dev, struct device_attribute *da, | |||
| 250 | if (result < 0) | 250 | if (result < 0) |
| 251 | return result; | 251 | return result; |
| 252 | 252 | ||
| 253 | val = DIV_ROUND_CLOSEST(val, 1000); | 253 | val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -63, 127); |
| 254 | if ((val < -63) || (val > 127)) | ||
| 255 | return -EINVAL; | ||
| 256 | 254 | ||
| 257 | mutex_lock(&data->update_lock); | 255 | mutex_lock(&data->update_lock); |
| 258 | data->temp_min[nr] = val; | 256 | data->temp_min[nr] = val; |
| @@ -274,9 +272,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *da, | |||
| 274 | if (result < 0) | 272 | if (result < 0) |
| 275 | return result; | 273 | return result; |
| 276 | 274 | ||
| 277 | val = DIV_ROUND_CLOSEST(val, 1000); | 275 | val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -63, 127); |
| 278 | if ((val < -63) || (val > 127)) | ||
| 279 | return -EINVAL; | ||
| 280 | 276 | ||
| 281 | mutex_lock(&data->update_lock); | 277 | mutex_lock(&data->update_lock); |
| 282 | data->temp_max[nr] = val; | 278 | data->temp_max[nr] = val; |
| @@ -390,15 +386,14 @@ static ssize_t set_fan_target(struct device *dev, struct device_attribute *da, | |||
| 390 | { | 386 | { |
| 391 | struct emc2103_data *data = emc2103_update_device(dev); | 387 | struct emc2103_data *data = emc2103_update_device(dev); |
| 392 | struct i2c_client *client = to_i2c_client(dev); | 388 | struct i2c_client *client = to_i2c_client(dev); |
| 393 | long rpm_target; | 389 | unsigned long rpm_target; |
| 394 | 390 | ||
| 395 | int result = kstrtol(buf, 10, &rpm_target); | 391 | int result = kstrtoul(buf, 10, &rpm_target); |
| 396 | if (result < 0) | 392 | if (result < 0) |
| 397 | return result; | 393 | return result; |
| 398 | 394 | ||
| 399 | /* Datasheet states 16384 as maximum RPM target (table 3.2) */ | 395 | /* Datasheet states 16384 as maximum RPM target (table 3.2) */ |
| 400 | if ((rpm_target < 0) || (rpm_target > 16384)) | 396 | rpm_target = clamp_val(rpm_target, 0, 16384); |
| 401 | return -EINVAL; | ||
| 402 | 397 | ||
| 403 | mutex_lock(&data->update_lock); | 398 | mutex_lock(&data->update_lock); |
| 404 | 399 | ||
diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c index bdfbe9114889..ae66f42c4d6d 100644 --- a/drivers/hwmon/ntc_thermistor.c +++ b/drivers/hwmon/ntc_thermistor.c | |||
| @@ -512,7 +512,7 @@ static int ntc_thermistor_probe(struct platform_device *pdev) | |||
| 512 | } | 512 | } |
| 513 | 513 | ||
| 514 | dev_info(&pdev->dev, "Thermistor type: %s successfully probed.\n", | 514 | dev_info(&pdev->dev, "Thermistor type: %s successfully probed.\n", |
| 515 | pdev->name); | 515 | pdev_id->name); |
| 516 | 516 | ||
| 517 | return 0; | 517 | return 0; |
| 518 | err_after_sysfs: | 518 | err_after_sysfs: |
diff --git a/drivers/i2c/busses/i2c-sun6i-p2wi.c b/drivers/i2c/busses/i2c-sun6i-p2wi.c index 09de4fd12d57..4d75d4759709 100644 --- a/drivers/i2c/busses/i2c-sun6i-p2wi.c +++ b/drivers/i2c/busses/i2c-sun6i-p2wi.c | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | * | 22 | * |
| 23 | */ | 23 | */ |
| 24 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
| 25 | #include <linux/module.h> | ||
| 26 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
| 27 | #include <linux/io.h> | 26 | #include <linux/io.h> |
| 28 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
diff --git a/drivers/i2c/muxes/Kconfig b/drivers/i2c/muxes/Kconfig index f7f9865b8b89..f6d313e528de 100644 --- a/drivers/i2c/muxes/Kconfig +++ b/drivers/i2c/muxes/Kconfig | |||
| @@ -40,6 +40,7 @@ config I2C_MUX_PCA9541 | |||
| 40 | 40 | ||
| 41 | config I2C_MUX_PCA954x | 41 | config I2C_MUX_PCA954x |
| 42 | tristate "Philips PCA954x I2C Mux/switches" | 42 | tristate "Philips PCA954x I2C Mux/switches" |
| 43 | depends on GPIOLIB | ||
| 43 | help | 44 | help |
| 44 | If you say yes here you get support for the Philips PCA954x | 45 | If you say yes here you get support for the Philips PCA954x |
| 45 | I2C mux/switch devices. | 46 | I2C mux/switch devices. |
diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c index 69abf9163df7..54e464e4bb72 100644 --- a/drivers/iio/accel/hid-sensor-accel-3d.c +++ b/drivers/iio/accel/hid-sensor-accel-3d.c | |||
| @@ -110,7 +110,6 @@ static int accel_3d_read_raw(struct iio_dev *indio_dev, | |||
| 110 | struct accel_3d_state *accel_state = iio_priv(indio_dev); | 110 | struct accel_3d_state *accel_state = iio_priv(indio_dev); |
| 111 | int report_id = -1; | 111 | int report_id = -1; |
| 112 | u32 address; | 112 | u32 address; |
| 113 | int ret; | ||
| 114 | int ret_type; | 113 | int ret_type; |
| 115 | s32 poll_value; | 114 | s32 poll_value; |
| 116 | 115 | ||
| @@ -151,14 +150,12 @@ static int accel_3d_read_raw(struct iio_dev *indio_dev, | |||
| 151 | ret_type = IIO_VAL_INT; | 150 | ret_type = IIO_VAL_INT; |
| 152 | break; | 151 | break; |
| 153 | case IIO_CHAN_INFO_SAMP_FREQ: | 152 | case IIO_CHAN_INFO_SAMP_FREQ: |
| 154 | ret = hid_sensor_read_samp_freq_value( | 153 | ret_type = hid_sensor_read_samp_freq_value( |
| 155 | &accel_state->common_attributes, val, val2); | 154 | &accel_state->common_attributes, val, val2); |
| 156 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
| 157 | break; | 155 | break; |
| 158 | case IIO_CHAN_INFO_HYSTERESIS: | 156 | case IIO_CHAN_INFO_HYSTERESIS: |
| 159 | ret = hid_sensor_read_raw_hyst_value( | 157 | ret_type = hid_sensor_read_raw_hyst_value( |
| 160 | &accel_state->common_attributes, val, val2); | 158 | &accel_state->common_attributes, val, val2); |
| 161 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
| 162 | break; | 159 | break; |
| 163 | default: | 160 | default: |
| 164 | ret_type = -EINVAL; | 161 | ret_type = -EINVAL; |
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index a4db3026bec6..d5dc4c6ce86c 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c | |||
| @@ -374,7 +374,7 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, | |||
| 374 | return -EAGAIN; | 374 | return -EAGAIN; |
| 375 | } | 375 | } |
| 376 | } | 376 | } |
| 377 | map_val = chan->channel + TOTAL_CHANNELS; | 377 | map_val = adc_dev->channel_step[chan->scan_index]; |
| 378 | 378 | ||
| 379 | /* | 379 | /* |
| 380 | * We check the complete FIFO. We programmed just one entry but in case | 380 | * We check the complete FIFO. We programmed just one entry but in case |
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c index 40f4e4935d0d..fa034a3dad78 100644 --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c | |||
| @@ -110,7 +110,6 @@ static int gyro_3d_read_raw(struct iio_dev *indio_dev, | |||
| 110 | struct gyro_3d_state *gyro_state = iio_priv(indio_dev); | 110 | struct gyro_3d_state *gyro_state = iio_priv(indio_dev); |
| 111 | int report_id = -1; | 111 | int report_id = -1; |
| 112 | u32 address; | 112 | u32 address; |
| 113 | int ret; | ||
| 114 | int ret_type; | 113 | int ret_type; |
| 115 | s32 poll_value; | 114 | s32 poll_value; |
| 116 | 115 | ||
| @@ -151,14 +150,12 @@ static int gyro_3d_read_raw(struct iio_dev *indio_dev, | |||
| 151 | ret_type = IIO_VAL_INT; | 150 | ret_type = IIO_VAL_INT; |
| 152 | break; | 151 | break; |
| 153 | case IIO_CHAN_INFO_SAMP_FREQ: | 152 | case IIO_CHAN_INFO_SAMP_FREQ: |
| 154 | ret = hid_sensor_read_samp_freq_value( | 153 | ret_type = hid_sensor_read_samp_freq_value( |
| 155 | &gyro_state->common_attributes, val, val2); | 154 | &gyro_state->common_attributes, val, val2); |
| 156 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
| 157 | break; | 155 | break; |
| 158 | case IIO_CHAN_INFO_HYSTERESIS: | 156 | case IIO_CHAN_INFO_HYSTERESIS: |
| 159 | ret = hid_sensor_read_raw_hyst_value( | 157 | ret_type = hid_sensor_read_raw_hyst_value( |
| 160 | &gyro_state->common_attributes, val, val2); | 158 | &gyro_state->common_attributes, val, val2); |
| 161 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
| 162 | break; | 159 | break; |
| 163 | default: | 160 | default: |
| 164 | ret_type = -EINVAL; | 161 | ret_type = -EINVAL; |
diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c index f34c94380b41..96e71e103ea7 100644 --- a/drivers/iio/light/hid-sensor-als.c +++ b/drivers/iio/light/hid-sensor-als.c | |||
| @@ -79,7 +79,6 @@ static int als_read_raw(struct iio_dev *indio_dev, | |||
| 79 | struct als_state *als_state = iio_priv(indio_dev); | 79 | struct als_state *als_state = iio_priv(indio_dev); |
| 80 | int report_id = -1; | 80 | int report_id = -1; |
| 81 | u32 address; | 81 | u32 address; |
| 82 | int ret; | ||
| 83 | int ret_type; | 82 | int ret_type; |
| 84 | s32 poll_value; | 83 | s32 poll_value; |
| 85 | 84 | ||
| @@ -129,14 +128,12 @@ static int als_read_raw(struct iio_dev *indio_dev, | |||
| 129 | ret_type = IIO_VAL_INT; | 128 | ret_type = IIO_VAL_INT; |
| 130 | break; | 129 | break; |
| 131 | case IIO_CHAN_INFO_SAMP_FREQ: | 130 | case IIO_CHAN_INFO_SAMP_FREQ: |
| 132 | ret = hid_sensor_read_samp_freq_value( | 131 | ret_type = hid_sensor_read_samp_freq_value( |
| 133 | &als_state->common_attributes, val, val2); | 132 | &als_state->common_attributes, val, val2); |
| 134 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
| 135 | break; | 133 | break; |
| 136 | case IIO_CHAN_INFO_HYSTERESIS: | 134 | case IIO_CHAN_INFO_HYSTERESIS: |
| 137 | ret = hid_sensor_read_raw_hyst_value( | 135 | ret_type = hid_sensor_read_raw_hyst_value( |
| 138 | &als_state->common_attributes, val, val2); | 136 | &als_state->common_attributes, val, val2); |
| 139 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
| 140 | break; | 137 | break; |
| 141 | default: | 138 | default: |
| 142 | ret_type = -EINVAL; | 139 | ret_type = -EINVAL; |
diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c index d203ef4d892f..412bae86d6ae 100644 --- a/drivers/iio/light/hid-sensor-prox.c +++ b/drivers/iio/light/hid-sensor-prox.c | |||
| @@ -74,7 +74,6 @@ static int prox_read_raw(struct iio_dev *indio_dev, | |||
| 74 | struct prox_state *prox_state = iio_priv(indio_dev); | 74 | struct prox_state *prox_state = iio_priv(indio_dev); |
| 75 | int report_id = -1; | 75 | int report_id = -1; |
| 76 | u32 address; | 76 | u32 address; |
| 77 | int ret; | ||
| 78 | int ret_type; | 77 | int ret_type; |
| 79 | s32 poll_value; | 78 | s32 poll_value; |
| 80 | 79 | ||
| @@ -125,14 +124,12 @@ static int prox_read_raw(struct iio_dev *indio_dev, | |||
| 125 | ret_type = IIO_VAL_INT; | 124 | ret_type = IIO_VAL_INT; |
| 126 | break; | 125 | break; |
| 127 | case IIO_CHAN_INFO_SAMP_FREQ: | 126 | case IIO_CHAN_INFO_SAMP_FREQ: |
| 128 | ret = hid_sensor_read_samp_freq_value( | 127 | ret_type = hid_sensor_read_samp_freq_value( |
| 129 | &prox_state->common_attributes, val, val2); | 128 | &prox_state->common_attributes, val, val2); |
| 130 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
| 131 | break; | 129 | break; |
| 132 | case IIO_CHAN_INFO_HYSTERESIS: | 130 | case IIO_CHAN_INFO_HYSTERESIS: |
| 133 | ret = hid_sensor_read_raw_hyst_value( | 131 | ret_type = hid_sensor_read_raw_hyst_value( |
| 134 | &prox_state->common_attributes, val, val2); | 132 | &prox_state->common_attributes, val, val2); |
| 135 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
| 136 | break; | 133 | break; |
| 137 | default: | 134 | default: |
| 138 | ret_type = -EINVAL; | 135 | ret_type = -EINVAL; |
diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c index fe063a0a21cd..752569985d1d 100644 --- a/drivers/iio/light/tcs3472.c +++ b/drivers/iio/light/tcs3472.c | |||
| @@ -52,6 +52,7 @@ | |||
| 52 | 52 | ||
| 53 | struct tcs3472_data { | 53 | struct tcs3472_data { |
| 54 | struct i2c_client *client; | 54 | struct i2c_client *client; |
| 55 | struct mutex lock; | ||
| 55 | u8 enable; | 56 | u8 enable; |
| 56 | u8 control; | 57 | u8 control; |
| 57 | u8 atime; | 58 | u8 atime; |
| @@ -116,10 +117,17 @@ static int tcs3472_read_raw(struct iio_dev *indio_dev, | |||
| 116 | 117 | ||
| 117 | switch (mask) { | 118 | switch (mask) { |
| 118 | case IIO_CHAN_INFO_RAW: | 119 | case IIO_CHAN_INFO_RAW: |
| 120 | if (iio_buffer_enabled(indio_dev)) | ||
| 121 | return -EBUSY; | ||
| 122 | |||
| 123 | mutex_lock(&data->lock); | ||
| 119 | ret = tcs3472_req_data(data); | 124 | ret = tcs3472_req_data(data); |
| 120 | if (ret < 0) | 125 | if (ret < 0) { |
| 126 | mutex_unlock(&data->lock); | ||
| 121 | return ret; | 127 | return ret; |
| 128 | } | ||
| 122 | ret = i2c_smbus_read_word_data(data->client, chan->address); | 129 | ret = i2c_smbus_read_word_data(data->client, chan->address); |
| 130 | mutex_unlock(&data->lock); | ||
| 123 | if (ret < 0) | 131 | if (ret < 0) |
| 124 | return ret; | 132 | return ret; |
| 125 | *val = ret; | 133 | *val = ret; |
| @@ -255,6 +263,7 @@ static int tcs3472_probe(struct i2c_client *client, | |||
| 255 | data = iio_priv(indio_dev); | 263 | data = iio_priv(indio_dev); |
| 256 | i2c_set_clientdata(client, indio_dev); | 264 | i2c_set_clientdata(client, indio_dev); |
| 257 | data->client = client; | 265 | data->client = client; |
| 266 | mutex_init(&data->lock); | ||
| 258 | 267 | ||
| 259 | indio_dev->dev.parent = &client->dev; | 268 | indio_dev->dev.parent = &client->dev; |
| 260 | indio_dev->info = &tcs3472_info; | 269 | indio_dev->info = &tcs3472_info; |
diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c index 41cf29e2a371..b2b0937d5133 100644 --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c | |||
| @@ -110,7 +110,6 @@ static int magn_3d_read_raw(struct iio_dev *indio_dev, | |||
| 110 | struct magn_3d_state *magn_state = iio_priv(indio_dev); | 110 | struct magn_3d_state *magn_state = iio_priv(indio_dev); |
| 111 | int report_id = -1; | 111 | int report_id = -1; |
| 112 | u32 address; | 112 | u32 address; |
| 113 | int ret; | ||
| 114 | int ret_type; | 113 | int ret_type; |
| 115 | s32 poll_value; | 114 | s32 poll_value; |
| 116 | 115 | ||
| @@ -153,14 +152,12 @@ static int magn_3d_read_raw(struct iio_dev *indio_dev, | |||
| 153 | ret_type = IIO_VAL_INT; | 152 | ret_type = IIO_VAL_INT; |
| 154 | break; | 153 | break; |
| 155 | case IIO_CHAN_INFO_SAMP_FREQ: | 154 | case IIO_CHAN_INFO_SAMP_FREQ: |
| 156 | ret = hid_sensor_read_samp_freq_value( | 155 | ret_type = hid_sensor_read_samp_freq_value( |
| 157 | &magn_state->common_attributes, val, val2); | 156 | &magn_state->common_attributes, val, val2); |
| 158 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
| 159 | break; | 157 | break; |
| 160 | case IIO_CHAN_INFO_HYSTERESIS: | 158 | case IIO_CHAN_INFO_HYSTERESIS: |
| 161 | ret = hid_sensor_read_raw_hyst_value( | 159 | ret_type = hid_sensor_read_raw_hyst_value( |
| 162 | &magn_state->common_attributes, val, val2); | 160 | &magn_state->common_attributes, val, val2); |
| 163 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
| 164 | break; | 161 | break; |
| 165 | default: | 162 | default: |
| 166 | ret_type = -EINVAL; | 163 | ret_type = -EINVAL; |
diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c index 1cd190c73788..2c0d2a4fed8c 100644 --- a/drivers/iio/pressure/hid-sensor-press.c +++ b/drivers/iio/pressure/hid-sensor-press.c | |||
| @@ -78,7 +78,6 @@ static int press_read_raw(struct iio_dev *indio_dev, | |||
| 78 | struct press_state *press_state = iio_priv(indio_dev); | 78 | struct press_state *press_state = iio_priv(indio_dev); |
| 79 | int report_id = -1; | 79 | int report_id = -1; |
| 80 | u32 address; | 80 | u32 address; |
| 81 | int ret; | ||
| 82 | int ret_type; | 81 | int ret_type; |
| 83 | s32 poll_value; | 82 | s32 poll_value; |
| 84 | 83 | ||
| @@ -128,14 +127,12 @@ static int press_read_raw(struct iio_dev *indio_dev, | |||
| 128 | ret_type = IIO_VAL_INT; | 127 | ret_type = IIO_VAL_INT; |
| 129 | break; | 128 | break; |
| 130 | case IIO_CHAN_INFO_SAMP_FREQ: | 129 | case IIO_CHAN_INFO_SAMP_FREQ: |
| 131 | ret = hid_sensor_read_samp_freq_value( | 130 | ret_type = hid_sensor_read_samp_freq_value( |
| 132 | &press_state->common_attributes, val, val2); | 131 | &press_state->common_attributes, val, val2); |
| 133 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
| 134 | break; | 132 | break; |
| 135 | case IIO_CHAN_INFO_HYSTERESIS: | 133 | case IIO_CHAN_INFO_HYSTERESIS: |
| 136 | ret = hid_sensor_read_raw_hyst_value( | 134 | ret_type = hid_sensor_read_raw_hyst_value( |
| 137 | &press_state->common_attributes, val, val2); | 135 | &press_state->common_attributes, val, val2); |
| 138 | ret_type = IIO_VAL_INT_PLUS_MICRO; | ||
| 139 | break; | 136 | break; |
| 140 | default: | 137 | default: |
| 141 | ret_type = -EINVAL; | 138 | ret_type = -EINVAL; |
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 53b213226c01..4cba2d808afb 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2003 Christophe Saout <christophe@saout.de> | 2 | * Copyright (C) 2003 Jana Saout <jana@saout.de> |
| 3 | * Copyright (C) 2004 Clemens Fruhwirth <clemens@endorphin.org> | 3 | * Copyright (C) 2004 Clemens Fruhwirth <clemens@endorphin.org> |
| 4 | * Copyright (C) 2006-2009 Red Hat, Inc. All rights reserved. | 4 | * Copyright (C) 2006-2009 Red Hat, Inc. All rights reserved. |
| 5 | * Copyright (C) 2013 Milan Broz <gmazyland@gmail.com> | 5 | * Copyright (C) 2013 Milan Broz <gmazyland@gmail.com> |
| @@ -1996,6 +1996,6 @@ static void __exit dm_crypt_exit(void) | |||
| 1996 | module_init(dm_crypt_init); | 1996 | module_init(dm_crypt_init); |
| 1997 | module_exit(dm_crypt_exit); | 1997 | module_exit(dm_crypt_exit); |
| 1998 | 1998 | ||
| 1999 | MODULE_AUTHOR("Christophe Saout <christophe@saout.de>"); | 1999 | MODULE_AUTHOR("Jana Saout <jana@saout.de>"); |
| 2000 | MODULE_DESCRIPTION(DM_NAME " target for transparent encryption / decryption"); | 2000 | MODULE_DESCRIPTION(DM_NAME " target for transparent encryption / decryption"); |
| 2001 | MODULE_LICENSE("GPL"); | 2001 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index 3842ac738f98..db404a0f7e2c 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/device-mapper.h> | 10 | #include <linux/device-mapper.h> |
| 11 | 11 | ||
| 12 | #include <linux/bio.h> | 12 | #include <linux/bio.h> |
| 13 | #include <linux/completion.h> | ||
| 13 | #include <linux/mempool.h> | 14 | #include <linux/mempool.h> |
| 14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 15 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| @@ -32,7 +33,7 @@ struct dm_io_client { | |||
| 32 | struct io { | 33 | struct io { |
| 33 | unsigned long error_bits; | 34 | unsigned long error_bits; |
| 34 | atomic_t count; | 35 | atomic_t count; |
| 35 | struct task_struct *sleeper; | 36 | struct completion *wait; |
| 36 | struct dm_io_client *client; | 37 | struct dm_io_client *client; |
| 37 | io_notify_fn callback; | 38 | io_notify_fn callback; |
| 38 | void *context; | 39 | void *context; |
| @@ -121,8 +122,8 @@ static void dec_count(struct io *io, unsigned int region, int error) | |||
| 121 | invalidate_kernel_vmap_range(io->vma_invalidate_address, | 122 | invalidate_kernel_vmap_range(io->vma_invalidate_address, |
| 122 | io->vma_invalidate_size); | 123 | io->vma_invalidate_size); |
| 123 | 124 | ||
| 124 | if (io->sleeper) | 125 | if (io->wait) |
| 125 | wake_up_process(io->sleeper); | 126 | complete(io->wait); |
| 126 | 127 | ||
| 127 | else { | 128 | else { |
| 128 | unsigned long r = io->error_bits; | 129 | unsigned long r = io->error_bits; |
| @@ -387,6 +388,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions, | |||
| 387 | */ | 388 | */ |
| 388 | volatile char io_[sizeof(struct io) + __alignof__(struct io) - 1]; | 389 | volatile char io_[sizeof(struct io) + __alignof__(struct io) - 1]; |
| 389 | struct io *io = (struct io *)PTR_ALIGN(&io_, __alignof__(struct io)); | 390 | struct io *io = (struct io *)PTR_ALIGN(&io_, __alignof__(struct io)); |
| 391 | DECLARE_COMPLETION_ONSTACK(wait); | ||
| 390 | 392 | ||
| 391 | if (num_regions > 1 && (rw & RW_MASK) != WRITE) { | 393 | if (num_regions > 1 && (rw & RW_MASK) != WRITE) { |
| 392 | WARN_ON(1); | 394 | WARN_ON(1); |
| @@ -395,7 +397,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions, | |||
| 395 | 397 | ||
| 396 | io->error_bits = 0; | 398 | io->error_bits = 0; |
| 397 | atomic_set(&io->count, 1); /* see dispatch_io() */ | 399 | atomic_set(&io->count, 1); /* see dispatch_io() */ |
| 398 | io->sleeper = current; | 400 | io->wait = &wait; |
| 399 | io->client = client; | 401 | io->client = client; |
| 400 | 402 | ||
| 401 | io->vma_invalidate_address = dp->vma_invalidate_address; | 403 | io->vma_invalidate_address = dp->vma_invalidate_address; |
| @@ -403,15 +405,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions, | |||
| 403 | 405 | ||
| 404 | dispatch_io(rw, num_regions, where, dp, io, 1); | 406 | dispatch_io(rw, num_regions, where, dp, io, 1); |
| 405 | 407 | ||
| 406 | while (1) { | 408 | wait_for_completion_io(&wait); |
| 407 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
| 408 | |||
| 409 | if (!atomic_read(&io->count)) | ||
| 410 | break; | ||
| 411 | |||
| 412 | io_schedule(); | ||
| 413 | } | ||
| 414 | set_current_state(TASK_RUNNING); | ||
| 415 | 409 | ||
| 416 | if (error_bits) | 410 | if (error_bits) |
| 417 | *error_bits = io->error_bits; | 411 | *error_bits = io->error_bits; |
| @@ -434,7 +428,7 @@ static int async_io(struct dm_io_client *client, unsigned int num_regions, | |||
| 434 | io = mempool_alloc(client->pool, GFP_NOIO); | 428 | io = mempool_alloc(client->pool, GFP_NOIO); |
| 435 | io->error_bits = 0; | 429 | io->error_bits = 0; |
| 436 | atomic_set(&io->count, 1); /* see dispatch_io() */ | 430 | atomic_set(&io->count, 1); /* see dispatch_io() */ |
| 437 | io->sleeper = NULL; | 431 | io->wait = NULL; |
| 438 | io->client = client; | 432 | io->client = client; |
| 439 | io->callback = fn; | 433 | io->callback = fn; |
| 440 | io->context = context; | 434 | io->context = context; |
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 3f6fd9d33ba3..f4167b013d99 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
| @@ -1611,8 +1611,9 @@ static int multipath_busy(struct dm_target *ti) | |||
| 1611 | 1611 | ||
| 1612 | spin_lock_irqsave(&m->lock, flags); | 1612 | spin_lock_irqsave(&m->lock, flags); |
| 1613 | 1613 | ||
| 1614 | /* pg_init in progress, requeue until done */ | 1614 | /* pg_init in progress or no paths available */ |
| 1615 | if (!pg_ready(m)) { | 1615 | if (m->pg_init_in_progress || |
| 1616 | (!m->nr_valid_paths && m->queue_if_no_path)) { | ||
| 1616 | busy = 1; | 1617 | busy = 1; |
| 1617 | goto out; | 1618 | goto out; |
| 1618 | } | 1619 | } |
diff --git a/drivers/md/dm-zero.c b/drivers/md/dm-zero.c index c99003e0d47a..b9a64bbce304 100644 --- a/drivers/md/dm-zero.c +++ b/drivers/md/dm-zero.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2003 Christophe Saout <christophe@saout.de> | 2 | * Copyright (C) 2003 Jana Saout <jana@saout.de> |
| 3 | * | 3 | * |
| 4 | * This file is released under the GPL. | 4 | * This file is released under the GPL. |
| 5 | */ | 5 | */ |
| @@ -79,6 +79,6 @@ static void __exit dm_zero_exit(void) | |||
| 79 | module_init(dm_zero_init) | 79 | module_init(dm_zero_init) |
| 80 | module_exit(dm_zero_exit) | 80 | module_exit(dm_zero_exit) |
| 81 | 81 | ||
| 82 | MODULE_AUTHOR("Christophe Saout <christophe@saout.de>"); | 82 | MODULE_AUTHOR("Jana Saout <jana@saout.de>"); |
| 83 | MODULE_DESCRIPTION(DM_NAME " dummy target returning zeros"); | 83 | MODULE_DESCRIPTION(DM_NAME " dummy target returning zeros"); |
| 84 | MODULE_LICENSE("GPL"); | 84 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 437d99045ef2..32b958dbc499 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
| @@ -54,6 +54,8 @@ static void do_deferred_remove(struct work_struct *w); | |||
| 54 | 54 | ||
| 55 | static DECLARE_WORK(deferred_remove_work, do_deferred_remove); | 55 | static DECLARE_WORK(deferred_remove_work, do_deferred_remove); |
| 56 | 56 | ||
| 57 | static struct workqueue_struct *deferred_remove_workqueue; | ||
| 58 | |||
| 57 | /* | 59 | /* |
| 58 | * For bio-based dm. | 60 | * For bio-based dm. |
| 59 | * One of these is allocated per bio. | 61 | * One of these is allocated per bio. |
| @@ -276,16 +278,24 @@ static int __init local_init(void) | |||
| 276 | if (r) | 278 | if (r) |
| 277 | goto out_free_rq_tio_cache; | 279 | goto out_free_rq_tio_cache; |
| 278 | 280 | ||
| 281 | deferred_remove_workqueue = alloc_workqueue("kdmremove", WQ_UNBOUND, 1); | ||
| 282 | if (!deferred_remove_workqueue) { | ||
| 283 | r = -ENOMEM; | ||
| 284 | goto out_uevent_exit; | ||
| 285 | } | ||
| 286 | |||
| 279 | _major = major; | 287 | _major = major; |
| 280 | r = register_blkdev(_major, _name); | 288 | r = register_blkdev(_major, _name); |
| 281 | if (r < 0) | 289 | if (r < 0) |
| 282 | goto out_uevent_exit; | 290 | goto out_free_workqueue; |
| 283 | 291 | ||
| 284 | if (!_major) | 292 | if (!_major) |
| 285 | _major = r; | 293 | _major = r; |
| 286 | 294 | ||
| 287 | return 0; | 295 | return 0; |
| 288 | 296 | ||
| 297 | out_free_workqueue: | ||
| 298 | destroy_workqueue(deferred_remove_workqueue); | ||
| 289 | out_uevent_exit: | 299 | out_uevent_exit: |
| 290 | dm_uevent_exit(); | 300 | dm_uevent_exit(); |
| 291 | out_free_rq_tio_cache: | 301 | out_free_rq_tio_cache: |
| @@ -299,6 +309,7 @@ out_free_io_cache: | |||
| 299 | static void local_exit(void) | 309 | static void local_exit(void) |
| 300 | { | 310 | { |
| 301 | flush_scheduled_work(); | 311 | flush_scheduled_work(); |
| 312 | destroy_workqueue(deferred_remove_workqueue); | ||
| 302 | 313 | ||
| 303 | kmem_cache_destroy(_rq_tio_cache); | 314 | kmem_cache_destroy(_rq_tio_cache); |
| 304 | kmem_cache_destroy(_io_cache); | 315 | kmem_cache_destroy(_io_cache); |
| @@ -407,7 +418,7 @@ static void dm_blk_close(struct gendisk *disk, fmode_t mode) | |||
| 407 | 418 | ||
| 408 | if (atomic_dec_and_test(&md->open_count) && | 419 | if (atomic_dec_and_test(&md->open_count) && |
| 409 | (test_bit(DMF_DEFERRED_REMOVE, &md->flags))) | 420 | (test_bit(DMF_DEFERRED_REMOVE, &md->flags))) |
| 410 | schedule_work(&deferred_remove_work); | 421 | queue_work(deferred_remove_workqueue, &deferred_remove_work); |
| 411 | 422 | ||
| 412 | dm_put(md); | 423 | dm_put(md); |
| 413 | 424 | ||
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 63a54a340863..1c8592b0e146 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -3135,8 +3135,13 @@ static int pci_af_flr(struct pci_dev *dev, int probe) | |||
| 3135 | if (probe) | 3135 | if (probe) |
| 3136 | return 0; | 3136 | return 0; |
| 3137 | 3137 | ||
| 3138 | /* Wait for Transaction Pending bit clean */ | 3138 | /* |
| 3139 | if (pci_wait_for_pending(dev, pos + PCI_AF_STATUS, PCI_AF_STATUS_TP)) | 3139 | * Wait for Transaction Pending bit to clear. A word-aligned test |
| 3140 | * is used, so we use the conrol offset rather than status and shift | ||
| 3141 | * the test bit to match. | ||
| 3142 | */ | ||
| 3143 | if (pci_wait_for_pending(dev, pos + PCI_AF_CTRL, | ||
| 3144 | PCI_AF_STATUS_TP << 8)) | ||
| 3140 | goto clear; | 3145 | goto clear; |
| 3141 | 3146 | ||
| 3142 | dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n"); | 3147 | dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n"); |
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 16a2f067c242..64b98d242ea6 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig | |||
| @@ -112,6 +112,7 @@ config PHY_EXYNOS5250_SATA | |||
| 112 | config PHY_SUN4I_USB | 112 | config PHY_SUN4I_USB |
| 113 | tristate "Allwinner sunxi SoC USB PHY driver" | 113 | tristate "Allwinner sunxi SoC USB PHY driver" |
| 114 | depends on ARCH_SUNXI && HAS_IOMEM && OF | 114 | depends on ARCH_SUNXI && HAS_IOMEM && OF |
| 115 | depends on RESET_CONTROLLER | ||
| 115 | select GENERIC_PHY | 116 | select GENERIC_PHY |
| 116 | help | 117 | help |
| 117 | Enable this to support the transceiver that is part of Allwinner | 118 | Enable this to support the transceiver that is part of Allwinner |
| @@ -122,6 +123,7 @@ config PHY_SUN4I_USB | |||
| 122 | 123 | ||
| 123 | config PHY_SAMSUNG_USB2 | 124 | config PHY_SAMSUNG_USB2 |
| 124 | tristate "Samsung USB 2.0 PHY driver" | 125 | tristate "Samsung USB 2.0 PHY driver" |
| 126 | depends on HAS_IOMEM | ||
| 125 | select GENERIC_PHY | 127 | select GENERIC_PHY |
| 126 | select MFD_SYSCON | 128 | select MFD_SYSCON |
| 127 | help | 129 | help |
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index c64a2f3b2d62..49c446530101 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c | |||
| @@ -614,8 +614,9 @@ struct phy *phy_create(struct device *dev, const struct phy_ops *ops, | |||
| 614 | return phy; | 614 | return phy; |
| 615 | 615 | ||
| 616 | put_dev: | 616 | put_dev: |
| 617 | put_device(&phy->dev); | 617 | put_device(&phy->dev); /* calls phy_release() which frees resources */ |
| 618 | ida_remove(&phy_ida, phy->id); | 618 | return ERR_PTR(ret); |
| 619 | |||
| 619 | free_phy: | 620 | free_phy: |
| 620 | kfree(phy); | 621 | kfree(phy); |
| 621 | return ERR_PTR(ret); | 622 | return ERR_PTR(ret); |
| @@ -799,7 +800,7 @@ static void phy_release(struct device *dev) | |||
| 799 | 800 | ||
| 800 | phy = to_phy(dev); | 801 | phy = to_phy(dev); |
| 801 | dev_vdbg(dev, "releasing '%s'\n", dev_name(dev)); | 802 | dev_vdbg(dev, "releasing '%s'\n", dev_name(dev)); |
| 802 | ida_remove(&phy_ida, phy->id); | 803 | ida_simple_remove(&phy_ida, phy->id); |
| 803 | kfree(phy); | 804 | kfree(phy); |
| 804 | } | 805 | } |
| 805 | 806 | ||
diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index 7007c11fe07d..34b396146c8a 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c | |||
| @@ -233,8 +233,8 @@ static int omap_usb2_probe(struct platform_device *pdev) | |||
| 233 | if (phy_data->flags & OMAP_USB2_CALIBRATE_FALSE_DISCONNECT) { | 233 | if (phy_data->flags & OMAP_USB2_CALIBRATE_FALSE_DISCONNECT) { |
| 234 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 234 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 235 | phy->phy_base = devm_ioremap_resource(&pdev->dev, res); | 235 | phy->phy_base = devm_ioremap_resource(&pdev->dev, res); |
| 236 | if (!phy->phy_base) | 236 | if (IS_ERR(phy->phy_base)) |
| 237 | return -ENOMEM; | 237 | return PTR_ERR(phy->phy_base); |
| 238 | phy->flags |= OMAP_USB2_CALIBRATE_FALSE_DISCONNECT; | 238 | phy->flags |= OMAP_USB2_CALIBRATE_FALSE_DISCONNECT; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| @@ -262,7 +262,6 @@ static int omap_usb2_probe(struct platform_device *pdev) | |||
| 262 | otg->phy = &phy->phy; | 262 | otg->phy = &phy->phy; |
| 263 | 263 | ||
| 264 | platform_set_drvdata(pdev, phy); | 264 | platform_set_drvdata(pdev, phy); |
| 265 | pm_runtime_enable(phy->dev); | ||
| 266 | 265 | ||
| 267 | generic_phy = devm_phy_create(phy->dev, &ops, NULL); | 266 | generic_phy = devm_phy_create(phy->dev, &ops, NULL); |
| 268 | if (IS_ERR(generic_phy)) | 267 | if (IS_ERR(generic_phy)) |
| @@ -270,10 +269,13 @@ static int omap_usb2_probe(struct platform_device *pdev) | |||
| 270 | 269 | ||
| 271 | phy_set_drvdata(generic_phy, phy); | 270 | phy_set_drvdata(generic_phy, phy); |
| 272 | 271 | ||
| 272 | pm_runtime_enable(phy->dev); | ||
| 273 | phy_provider = devm_of_phy_provider_register(phy->dev, | 273 | phy_provider = devm_of_phy_provider_register(phy->dev, |
| 274 | of_phy_simple_xlate); | 274 | of_phy_simple_xlate); |
| 275 | if (IS_ERR(phy_provider)) | 275 | if (IS_ERR(phy_provider)) { |
| 276 | pm_runtime_disable(phy->dev); | ||
| 276 | return PTR_ERR(phy_provider); | 277 | return PTR_ERR(phy_provider); |
| 278 | } | ||
| 277 | 279 | ||
| 278 | phy->wkupclk = devm_clk_get(phy->dev, "wkupclk"); | 280 | phy->wkupclk = devm_clk_get(phy->dev, "wkupclk"); |
| 279 | if (IS_ERR(phy->wkupclk)) { | 281 | if (IS_ERR(phy->wkupclk)) { |
| @@ -317,6 +319,7 @@ static int omap_usb2_remove(struct platform_device *pdev) | |||
| 317 | if (!IS_ERR(phy->optclk)) | 319 | if (!IS_ERR(phy->optclk)) |
| 318 | clk_unprepare(phy->optclk); | 320 | clk_unprepare(phy->optclk); |
| 319 | usb_remove_phy(&phy->phy); | 321 | usb_remove_phy(&phy->phy); |
| 322 | pm_runtime_disable(phy->dev); | ||
| 320 | 323 | ||
| 321 | return 0; | 324 | return 0; |
| 322 | } | 325 | } |
diff --git a/drivers/phy/phy-samsung-usb2.c b/drivers/phy/phy-samsung-usb2.c index 8a8c6bc8709a..1e69a32c221d 100644 --- a/drivers/phy/phy-samsung-usb2.c +++ b/drivers/phy/phy-samsung-usb2.c | |||
| @@ -107,6 +107,7 @@ static const struct of_device_id samsung_usb2_phy_of_match[] = { | |||
| 107 | #endif | 107 | #endif |
| 108 | { }, | 108 | { }, |
| 109 | }; | 109 | }; |
| 110 | MODULE_DEVICE_TABLE(of, samsung_usb2_phy_of_match); | ||
| 110 | 111 | ||
| 111 | static int samsung_usb2_phy_probe(struct platform_device *pdev) | 112 | static int samsung_usb2_phy_probe(struct platform_device *pdev) |
| 112 | { | 113 | { |
diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c index edf5d2fd2b22..86db2235ab00 100644 --- a/drivers/pinctrl/berlin/berlin.c +++ b/drivers/pinctrl/berlin/berlin.c | |||
| @@ -320,7 +320,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev, | |||
| 320 | 320 | ||
| 321 | regmap = dev_get_regmap(&pdev->dev, NULL); | 321 | regmap = dev_get_regmap(&pdev->dev, NULL); |
| 322 | if (!regmap) | 322 | if (!regmap) |
| 323 | return PTR_ERR(regmap); | 323 | return -ENODEV; |
| 324 | 324 | ||
| 325 | pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); | 325 | pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); |
| 326 | if (!pctrl) | 326 | if (!pctrl) |
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index f1ca75e6d7b1..5f38c7f67834 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c | |||
| @@ -211,6 +211,10 @@ static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
| 211 | configlen++; | 211 | configlen++; |
| 212 | 212 | ||
| 213 | pinconfig = kzalloc(configlen * sizeof(*pinconfig), GFP_KERNEL); | 213 | pinconfig = kzalloc(configlen * sizeof(*pinconfig), GFP_KERNEL); |
| 214 | if (!pinconfig) { | ||
| 215 | kfree(*map); | ||
| 216 | return -ENOMEM; | ||
| 217 | } | ||
| 214 | 218 | ||
| 215 | if (!of_property_read_u32(node, "allwinner,drive", &val)) { | 219 | if (!of_property_read_u32(node, "allwinner,drive", &val)) { |
| 216 | u16 strength = (val + 1) * 10; | 220 | u16 strength = (val + 1) * 10; |
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index a99c63152b8d..2c516f2eebed 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c | |||
| @@ -306,7 +306,7 @@ static int imx_get_sensor_data(struct platform_device *pdev) | |||
| 306 | { | 306 | { |
| 307 | struct imx_thermal_data *data = platform_get_drvdata(pdev); | 307 | struct imx_thermal_data *data = platform_get_drvdata(pdev); |
| 308 | struct regmap *map; | 308 | struct regmap *map; |
| 309 | int t1, t2, n1, n2; | 309 | int t1, n1; |
| 310 | int ret; | 310 | int ret; |
| 311 | u32 val; | 311 | u32 val; |
| 312 | u64 temp64; | 312 | u64 temp64; |
| @@ -333,14 +333,10 @@ static int imx_get_sensor_data(struct platform_device *pdev) | |||
| 333 | /* | 333 | /* |
| 334 | * Sensor data layout: | 334 | * Sensor data layout: |
| 335 | * [31:20] - sensor value @ 25C | 335 | * [31:20] - sensor value @ 25C |
| 336 | * [19:8] - sensor value of hot | ||
| 337 | * [7:0] - hot temperature value | ||
| 338 | * Use universal formula now and only need sensor value @ 25C | 336 | * Use universal formula now and only need sensor value @ 25C |
| 339 | * slope = 0.4297157 - (0.0015976 * 25C fuse) | 337 | * slope = 0.4297157 - (0.0015976 * 25C fuse) |
| 340 | */ | 338 | */ |
| 341 | n1 = val >> 20; | 339 | n1 = val >> 20; |
| 342 | n2 = (val & 0xfff00) >> 8; | ||
| 343 | t2 = val & 0xff; | ||
| 344 | t1 = 25; /* t1 always 25C */ | 340 | t1 = 25; /* t1 always 25C */ |
| 345 | 341 | ||
| 346 | /* | 342 | /* |
| @@ -366,16 +362,16 @@ static int imx_get_sensor_data(struct platform_device *pdev) | |||
| 366 | data->c2 = n1 * data->c1 + 1000 * t1; | 362 | data->c2 = n1 * data->c1 + 1000 * t1; |
| 367 | 363 | ||
| 368 | /* | 364 | /* |
| 369 | * Set the default passive cooling trip point to 20 °C below the | 365 | * Set the default passive cooling trip point, |
| 370 | * maximum die temperature. Can be changed from userspace. | 366 | * can be changed from userspace. |
| 371 | */ | 367 | */ |
| 372 | data->temp_passive = 1000 * (t2 - 20); | 368 | data->temp_passive = IMX_TEMP_PASSIVE; |
| 373 | 369 | ||
| 374 | /* | 370 | /* |
| 375 | * The maximum die temperature is t2, let's give 5 °C cushion | 371 | * The maximum die temperature set to 20 C higher than |
| 376 | * for noise and possible temperature rise between measurements. | 372 | * IMX_TEMP_PASSIVE. |
| 377 | */ | 373 | */ |
| 378 | data->temp_critical = 1000 * (t2 - 5); | 374 | data->temp_critical = 1000 * 20 + data->temp_passive; |
| 379 | 375 | ||
| 380 | return 0; | 376 | return 0; |
| 381 | } | 377 | } |
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index 04b1be7fa018..4b2b999b7611 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c | |||
| @@ -156,8 +156,8 @@ static int of_thermal_bind(struct thermal_zone_device *thermal, | |||
| 156 | 156 | ||
| 157 | ret = thermal_zone_bind_cooling_device(thermal, | 157 | ret = thermal_zone_bind_cooling_device(thermal, |
| 158 | tbp->trip_id, cdev, | 158 | tbp->trip_id, cdev, |
| 159 | tbp->min, | 159 | tbp->max, |
| 160 | tbp->max); | 160 | tbp->min); |
| 161 | if (ret) | 161 | if (ret) |
| 162 | return ret; | 162 | return ret; |
| 163 | } | 163 | } |
| @@ -712,11 +712,12 @@ thermal_of_build_thermal_zone(struct device_node *np) | |||
| 712 | } | 712 | } |
| 713 | 713 | ||
| 714 | i = 0; | 714 | i = 0; |
| 715 | for_each_child_of_node(child, gchild) | 715 | for_each_child_of_node(child, gchild) { |
| 716 | ret = thermal_of_populate_bind_params(gchild, &tz->tbps[i++], | 716 | ret = thermal_of_populate_bind_params(gchild, &tz->tbps[i++], |
| 717 | tz->trips, tz->ntrips); | 717 | tz->trips, tz->ntrips); |
| 718 | if (ret) | 718 | if (ret) |
| 719 | goto free_tbps; | 719 | goto free_tbps; |
| 720 | } | ||
| 720 | 721 | ||
| 721 | finish: | 722 | finish: |
| 722 | of_node_put(child); | 723 | of_node_put(child); |
diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c index fdb07199d9c2..1967bee4f076 100644 --- a/drivers/thermal/thermal_hwmon.c +++ b/drivers/thermal/thermal_hwmon.c | |||
| @@ -140,6 +140,12 @@ thermal_hwmon_lookup_temp(const struct thermal_hwmon_device *hwmon, | |||
| 140 | return NULL; | 140 | return NULL; |
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | static bool thermal_zone_crit_temp_valid(struct thermal_zone_device *tz) | ||
| 144 | { | ||
| 145 | unsigned long temp; | ||
| 146 | return tz->ops->get_crit_temp && !tz->ops->get_crit_temp(tz, &temp); | ||
| 147 | } | ||
| 148 | |||
| 143 | int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) | 149 | int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) |
| 144 | { | 150 | { |
| 145 | struct thermal_hwmon_device *hwmon; | 151 | struct thermal_hwmon_device *hwmon; |
| @@ -189,21 +195,18 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) | |||
| 189 | if (result) | 195 | if (result) |
| 190 | goto free_temp_mem; | 196 | goto free_temp_mem; |
| 191 | 197 | ||
| 192 | if (tz->ops->get_crit_temp) { | 198 | if (thermal_zone_crit_temp_valid(tz)) { |
| 193 | unsigned long temperature; | 199 | snprintf(temp->temp_crit.name, |
| 194 | if (!tz->ops->get_crit_temp(tz, &temperature)) { | 200 | sizeof(temp->temp_crit.name), |
| 195 | snprintf(temp->temp_crit.name, | ||
| 196 | sizeof(temp->temp_crit.name), | ||
| 197 | "temp%d_crit", hwmon->count); | 201 | "temp%d_crit", hwmon->count); |
| 198 | temp->temp_crit.attr.attr.name = temp->temp_crit.name; | 202 | temp->temp_crit.attr.attr.name = temp->temp_crit.name; |
| 199 | temp->temp_crit.attr.attr.mode = 0444; | 203 | temp->temp_crit.attr.attr.mode = 0444; |
| 200 | temp->temp_crit.attr.show = temp_crit_show; | 204 | temp->temp_crit.attr.show = temp_crit_show; |
| 201 | sysfs_attr_init(&temp->temp_crit.attr.attr); | 205 | sysfs_attr_init(&temp->temp_crit.attr.attr); |
| 202 | result = device_create_file(hwmon->device, | 206 | result = device_create_file(hwmon->device, |
| 203 | &temp->temp_crit.attr); | 207 | &temp->temp_crit.attr); |
| 204 | if (result) | 208 | if (result) |
| 205 | goto unregister_input; | 209 | goto unregister_input; |
| 206 | } | ||
| 207 | } | 210 | } |
| 208 | 211 | ||
| 209 | mutex_lock(&thermal_hwmon_list_lock); | 212 | mutex_lock(&thermal_hwmon_list_lock); |
| @@ -250,7 +253,7 @@ void thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz) | |||
| 250 | } | 253 | } |
| 251 | 254 | ||
| 252 | device_remove_file(hwmon->device, &temp->temp_input.attr); | 255 | device_remove_file(hwmon->device, &temp->temp_input.attr); |
| 253 | if (tz->ops->get_crit_temp) | 256 | if (thermal_zone_crit_temp_valid(tz)) |
| 254 | device_remove_file(hwmon->device, &temp->temp_crit.attr); | 257 | device_remove_file(hwmon->device, &temp->temp_crit.attr); |
| 255 | 258 | ||
| 256 | mutex_lock(&thermal_hwmon_list_lock); | 259 | mutex_lock(&thermal_hwmon_list_lock); |
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c index a1271b55103a..634b6ce0e63a 100644 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c | |||
| @@ -1155,7 +1155,7 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) | |||
| 1155 | /* register shadow for context save and restore */ | 1155 | /* register shadow for context save and restore */ |
| 1156 | bgp->regval = devm_kzalloc(&pdev->dev, sizeof(*bgp->regval) * | 1156 | bgp->regval = devm_kzalloc(&pdev->dev, sizeof(*bgp->regval) * |
| 1157 | bgp->conf->sensor_count, GFP_KERNEL); | 1157 | bgp->conf->sensor_count, GFP_KERNEL); |
| 1158 | if (!bgp) { | 1158 | if (!bgp->regval) { |
| 1159 | dev_err(&pdev->dev, "Unable to allocate mem for driver ref\n"); | 1159 | dev_err(&pdev->dev, "Unable to allocate mem for driver ref\n"); |
| 1160 | return ERR_PTR(-ENOMEM); | 1160 | return ERR_PTR(-ENOMEM); |
| 1161 | } | 1161 | } |
diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c index c9f5c9dcc15c..008c223eaf26 100644 --- a/drivers/tty/serial/arc_uart.c +++ b/drivers/tty/serial/arc_uart.c | |||
| @@ -177,7 +177,7 @@ static void arc_serial_tx_chars(struct arc_uart_port *uart) | |||
| 177 | uart->port.icount.tx++; | 177 | uart->port.icount.tx++; |
| 178 | uart->port.x_char = 0; | 178 | uart->port.x_char = 0; |
| 179 | sent = 1; | 179 | sent = 1; |
| 180 | } else if (xmit->tail != xmit->head) { /* TODO: uart_circ_empty */ | 180 | } else if (!uart_circ_empty(xmit)) { |
| 181 | ch = xmit->buf[xmit->tail]; | 181 | ch = xmit->buf[xmit->tail]; |
| 182 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); | 182 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); |
| 183 | uart->port.icount.tx++; | 183 | uart->port.icount.tx++; |
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index e2f93874989b..044e86d528ae 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
| @@ -567,6 +567,9 @@ static void imx_start_tx(struct uart_port *port) | |||
| 567 | struct imx_port *sport = (struct imx_port *)port; | 567 | struct imx_port *sport = (struct imx_port *)port; |
| 568 | unsigned long temp; | 568 | unsigned long temp; |
| 569 | 569 | ||
| 570 | if (uart_circ_empty(&port->state->xmit)) | ||
| 571 | return; | ||
| 572 | |||
| 570 | if (USE_IRDA(sport)) { | 573 | if (USE_IRDA(sport)) { |
| 571 | /* half duplex in IrDA mode; have to disable receive mode */ | 574 | /* half duplex in IrDA mode; have to disable receive mode */ |
| 572 | temp = readl(sport->port.membase + UCR4); | 575 | temp = readl(sport->port.membase + UCR4); |
diff --git a/drivers/tty/serial/ip22zilog.c b/drivers/tty/serial/ip22zilog.c index 1efd4c36ba0c..99b7b8697861 100644 --- a/drivers/tty/serial/ip22zilog.c +++ b/drivers/tty/serial/ip22zilog.c | |||
| @@ -603,6 +603,8 @@ static void ip22zilog_start_tx(struct uart_port *port) | |||
| 603 | } else { | 603 | } else { |
| 604 | struct circ_buf *xmit = &port->state->xmit; | 604 | struct circ_buf *xmit = &port->state->xmit; |
| 605 | 605 | ||
| 606 | if (uart_circ_empty(xmit)) | ||
| 607 | return; | ||
| 606 | writeb(xmit->buf[xmit->tail], &channel->data); | 608 | writeb(xmit->buf[xmit->tail], &channel->data); |
| 607 | ZSDELAY(); | 609 | ZSDELAY(); |
| 608 | ZS_WSYNC(channel); | 610 | ZS_WSYNC(channel); |
diff --git a/drivers/tty/serial/m32r_sio.c b/drivers/tty/serial/m32r_sio.c index 68f2c53e0b54..5702828fb62e 100644 --- a/drivers/tty/serial/m32r_sio.c +++ b/drivers/tty/serial/m32r_sio.c | |||
| @@ -266,9 +266,11 @@ static void m32r_sio_start_tx(struct uart_port *port) | |||
| 266 | if (!(up->ier & UART_IER_THRI)) { | 266 | if (!(up->ier & UART_IER_THRI)) { |
| 267 | up->ier |= UART_IER_THRI; | 267 | up->ier |= UART_IER_THRI; |
| 268 | serial_out(up, UART_IER, up->ier); | 268 | serial_out(up, UART_IER, up->ier); |
| 269 | serial_out(up, UART_TX, xmit->buf[xmit->tail]); | 269 | if (!uart_circ_empty(xmit)) { |
| 270 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); | 270 | serial_out(up, UART_TX, xmit->buf[xmit->tail]); |
| 271 | up->port.icount.tx++; | 271 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); |
| 272 | up->port.icount.tx++; | ||
| 273 | } | ||
| 272 | } | 274 | } |
| 273 | while((serial_in(up, UART_LSR) & UART_EMPTY) != UART_EMPTY); | 275 | while((serial_in(up, UART_LSR) & UART_EMPTY) != UART_EMPTY); |
| 274 | #else | 276 | #else |
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index 8193635103ee..f7ad5b903055 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c | |||
| @@ -653,6 +653,8 @@ static void pmz_start_tx(struct uart_port *port) | |||
| 653 | } else { | 653 | } else { |
| 654 | struct circ_buf *xmit = &port->state->xmit; | 654 | struct circ_buf *xmit = &port->state->xmit; |
| 655 | 655 | ||
| 656 | if (uart_circ_empty(xmit)) | ||
| 657 | goto out; | ||
| 656 | write_zsdata(uap, xmit->buf[xmit->tail]); | 658 | write_zsdata(uap, xmit->buf[xmit->tail]); |
| 657 | zssync(uap); | 659 | zssync(uap); |
| 658 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); | 660 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); |
| @@ -661,6 +663,7 @@ static void pmz_start_tx(struct uart_port *port) | |||
| 661 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | 663 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
| 662 | uart_write_wakeup(&uap->port); | 664 | uart_write_wakeup(&uap->port); |
| 663 | } | 665 | } |
| 666 | out: | ||
| 664 | pmz_debug("pmz: start_tx() done.\n"); | 667 | pmz_debug("pmz: start_tx() done.\n"); |
| 665 | } | 668 | } |
| 666 | 669 | ||
diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c index 80a58eca785b..2f57df9a71d9 100644 --- a/drivers/tty/serial/sunsab.c +++ b/drivers/tty/serial/sunsab.c | |||
| @@ -427,6 +427,9 @@ static void sunsab_start_tx(struct uart_port *port) | |||
| 427 | struct circ_buf *xmit = &up->port.state->xmit; | 427 | struct circ_buf *xmit = &up->port.state->xmit; |
| 428 | int i; | 428 | int i; |
| 429 | 429 | ||
| 430 | if (uart_circ_empty(xmit)) | ||
| 431 | return; | ||
| 432 | |||
| 430 | up->interrupt_mask1 &= ~(SAB82532_IMR1_ALLS|SAB82532_IMR1_XPR); | 433 | up->interrupt_mask1 &= ~(SAB82532_IMR1_ALLS|SAB82532_IMR1_XPR); |
| 431 | writeb(up->interrupt_mask1, &up->regs->w.imr1); | 434 | writeb(up->interrupt_mask1, &up->regs->w.imr1); |
| 432 | 435 | ||
diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c index a85db8b87156..02df3940b95e 100644 --- a/drivers/tty/serial/sunzilog.c +++ b/drivers/tty/serial/sunzilog.c | |||
| @@ -703,6 +703,8 @@ static void sunzilog_start_tx(struct uart_port *port) | |||
| 703 | } else { | 703 | } else { |
| 704 | struct circ_buf *xmit = &port->state->xmit; | 704 | struct circ_buf *xmit = &port->state->xmit; |
| 705 | 705 | ||
| 706 | if (uart_circ_empty(xmit)) | ||
| 707 | return; | ||
| 706 | writeb(xmit->buf[xmit->tail], &channel->data); | 708 | writeb(xmit->buf[xmit->tail], &channel->data); |
| 707 | ZSDELAY(); | 709 | ZSDELAY(); |
| 708 | ZS_WSYNC(channel); | 710 | ZS_WSYNC(channel); |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 762e4a5f5ae9..330df5ce435b 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
| @@ -153,6 +153,7 @@ static const struct usb_device_id id_table[] = { | |||
| 153 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ | 153 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ |
| 154 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ | 154 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ |
| 155 | { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ | 155 | { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ |
| 156 | { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ | ||
| 156 | { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ | 157 | { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ |
| 157 | { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */ | 158 | { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */ |
| 158 | { USB_DEVICE(0x1E29, 0x0501) }, /* Festo CMSP */ | 159 | { USB_DEVICE(0x1E29, 0x0501) }, /* Festo CMSP */ |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 115662c16dcc..8a3813be1b28 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
| @@ -720,7 +720,8 @@ static const struct usb_device_id id_table_combined[] = { | |||
| 720 | { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, | 720 | { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, |
| 721 | { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, | 721 | { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, |
| 722 | { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, | 722 | { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, |
| 723 | { USB_DEVICE(TESTO_VID, TESTO_USB_INTERFACE_PID) }, | 723 | { USB_DEVICE(TESTO_VID, TESTO_1_PID) }, |
| 724 | { USB_DEVICE(TESTO_VID, TESTO_3_PID) }, | ||
| 724 | { USB_DEVICE(FTDI_VID, FTDI_GAMMA_SCOUT_PID) }, | 725 | { USB_DEVICE(FTDI_VID, FTDI_GAMMA_SCOUT_PID) }, |
| 725 | { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13M_PID) }, | 726 | { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13M_PID) }, |
| 726 | { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) }, | 727 | { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) }, |
| @@ -944,6 +945,8 @@ static const struct usb_device_id id_table_combined[] = { | |||
| 944 | { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_2_PID) }, | 945 | { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_2_PID) }, |
| 945 | { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_3_PID) }, | 946 | { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_3_PID) }, |
| 946 | { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_4_PID) }, | 947 | { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_4_PID) }, |
| 948 | /* Infineon Devices */ | ||
| 949 | { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_PID, 1) }, | ||
| 947 | { } /* Terminating entry */ | 950 | { } /* Terminating entry */ |
| 948 | }; | 951 | }; |
| 949 | 952 | ||
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 500474c48f4b..c4777bc6aee0 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
| @@ -584,6 +584,12 @@ | |||
| 584 | #define RATOC_PRODUCT_ID_USB60F 0xb020 | 584 | #define RATOC_PRODUCT_ID_USB60F 0xb020 |
| 585 | 585 | ||
| 586 | /* | 586 | /* |
| 587 | * Infineon Technologies | ||
| 588 | */ | ||
| 589 | #define INFINEON_VID 0x058b | ||
| 590 | #define INFINEON_TRIBOARD_PID 0x0028 /* DAS JTAG TriBoard TC1798 V1.0 */ | ||
| 591 | |||
| 592 | /* | ||
| 587 | * Acton Research Corp. | 593 | * Acton Research Corp. |
| 588 | */ | 594 | */ |
| 589 | #define ACTON_VID 0x0647 /* Vendor ID */ | 595 | #define ACTON_VID 0x0647 /* Vendor ID */ |
| @@ -798,7 +804,8 @@ | |||
| 798 | * Submitted by Colin Leroy | 804 | * Submitted by Colin Leroy |
| 799 | */ | 805 | */ |
| 800 | #define TESTO_VID 0x128D | 806 | #define TESTO_VID 0x128D |
| 801 | #define TESTO_USB_INTERFACE_PID 0x0001 | 807 | #define TESTO_1_PID 0x0001 |
| 808 | #define TESTO_3_PID 0x0003 | ||
| 802 | 809 | ||
| 803 | /* | 810 | /* |
| 804 | * Mobility Electronics products. | 811 | * Mobility Electronics products. |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index ac73f49cd9f0..a9688940543d 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -1487,6 +1487,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 1487 | .driver_info = (kernel_ulong_t)&net_intf2_blacklist }, | 1487 | .driver_info = (kernel_ulong_t)&net_intf2_blacklist }, |
| 1488 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff), /* ZTE MF91 */ | 1488 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff), /* ZTE MF91 */ |
| 1489 | .driver_info = (kernel_ulong_t)&net_intf2_blacklist }, | 1489 | .driver_info = (kernel_ulong_t)&net_intf2_blacklist }, |
| 1490 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1428, 0xff, 0xff, 0xff), /* Telewell TW-LTE 4G v2 */ | ||
| 1491 | .driver_info = (kernel_ulong_t)&net_intf2_blacklist }, | ||
| 1490 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1533, 0xff, 0xff, 0xff) }, | 1492 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1533, 0xff, 0xff, 0xff) }, |
| 1491 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1534, 0xff, 0xff, 0xff) }, | 1493 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1534, 0xff, 0xff, 0xff) }, |
| 1492 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1535, 0xff, 0xff, 0xff) }, | 1494 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1535, 0xff, 0xff, 0xff) }, |
diff --git a/firmware/Makefile b/firmware/Makefile index 5747417069ca..0862d34cf7d1 100644 --- a/firmware/Makefile +++ b/firmware/Makefile | |||
| @@ -219,6 +219,12 @@ $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep) | |||
| 219 | obj-y += $(patsubst %,%.gen.o, $(fw-external-y)) | 219 | obj-y += $(patsubst %,%.gen.o, $(fw-external-y)) |
| 220 | obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y)) | 220 | obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y)) |
| 221 | 221 | ||
| 222 | ifeq ($(KBUILD_SRC),) | ||
| 223 | # Makefile.build only creates subdirectories for O= builds, but external | ||
| 224 | # firmware might live outside the kernel source tree | ||
| 225 | _dummy := $(foreach d,$(addprefix $(obj)/,$(dir $(fw-external-y))), $(shell [ -d $(d) ] || mkdir -p $(d))) | ||
| 226 | endif | ||
| 227 | |||
| 222 | # Remove .S files and binaries created from ihex | 228 | # Remove .S files and binaries created from ihex |
| 223 | # (during 'make clean' .config isn't included so they're all in $(fw-shipped-)) | 229 | # (during 'make clean' .config isn't included so they're all in $(fw-shipped-)) |
| 224 | targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \ | 230 | targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \ |
diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c index 3f5c188953a4..0b7e28e7eaa4 100644 --- a/fs/ext4/extents_status.c +++ b/fs/ext4/extents_status.c | |||
| @@ -966,10 +966,10 @@ retry: | |||
| 966 | continue; | 966 | continue; |
| 967 | } | 967 | } |
| 968 | 968 | ||
| 969 | if (ei->i_es_lru_nr == 0 || ei == locked_ei) | 969 | if (ei->i_es_lru_nr == 0 || ei == locked_ei || |
| 970 | !write_trylock(&ei->i_es_lock)) | ||
| 970 | continue; | 971 | continue; |
| 971 | 972 | ||
| 972 | write_lock(&ei->i_es_lock); | ||
| 973 | shrunk = __es_try_to_reclaim_extents(ei, nr_to_scan); | 973 | shrunk = __es_try_to_reclaim_extents(ei, nr_to_scan); |
| 974 | if (ei->i_es_lru_nr == 0) | 974 | if (ei->i_es_lru_nr == 0) |
| 975 | list_del_init(&ei->i_es_lru); | 975 | list_del_init(&ei->i_es_lru); |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index a87455df38bc..5b87fc36aab8 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
| @@ -338,7 +338,7 @@ out: | |||
| 338 | fatal = err; | 338 | fatal = err; |
| 339 | } else { | 339 | } else { |
| 340 | ext4_error(sb, "bit already cleared for inode %lu", ino); | 340 | ext4_error(sb, "bit already cleared for inode %lu", ino); |
| 341 | if (!EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) { | 341 | if (gdp && !EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) { |
| 342 | int count; | 342 | int count; |
| 343 | count = ext4_free_inodes_count(sb, gdp); | 343 | count = ext4_free_inodes_count(sb, gdp); |
| 344 | percpu_counter_sub(&sbi->s_freeinodes_counter, | 344 | percpu_counter_sub(&sbi->s_freeinodes_counter, |
| @@ -874,6 +874,13 @@ got: | |||
| 874 | goto out; | 874 | goto out; |
| 875 | } | 875 | } |
| 876 | 876 | ||
| 877 | BUFFER_TRACE(group_desc_bh, "get_write_access"); | ||
| 878 | err = ext4_journal_get_write_access(handle, group_desc_bh); | ||
| 879 | if (err) { | ||
| 880 | ext4_std_error(sb, err); | ||
| 881 | goto out; | ||
| 882 | } | ||
| 883 | |||
| 877 | /* We may have to initialize the block bitmap if it isn't already */ | 884 | /* We may have to initialize the block bitmap if it isn't already */ |
| 878 | if (ext4_has_group_desc_csum(sb) && | 885 | if (ext4_has_group_desc_csum(sb) && |
| 879 | gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { | 886 | gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { |
| @@ -910,13 +917,6 @@ got: | |||
| 910 | } | 917 | } |
| 911 | } | 918 | } |
| 912 | 919 | ||
| 913 | BUFFER_TRACE(group_desc_bh, "get_write_access"); | ||
| 914 | err = ext4_journal_get_write_access(handle, group_desc_bh); | ||
| 915 | if (err) { | ||
| 916 | ext4_std_error(sb, err); | ||
| 917 | goto out; | ||
| 918 | } | ||
| 919 | |||
| 920 | /* Update the relevant bg descriptor fields */ | 920 | /* Update the relevant bg descriptor fields */ |
| 921 | if (ext4_has_group_desc_csum(sb)) { | 921 | if (ext4_has_group_desc_csum(sb)) { |
| 922 | int free; | 922 | int free; |
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 7f72f50a8fa7..2dcb936be90e 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
| @@ -752,8 +752,8 @@ void ext4_mb_generate_buddy(struct super_block *sb, | |||
| 752 | 752 | ||
| 753 | if (free != grp->bb_free) { | 753 | if (free != grp->bb_free) { |
| 754 | ext4_grp_locked_error(sb, group, 0, 0, | 754 | ext4_grp_locked_error(sb, group, 0, 0, |
| 755 | "%u clusters in bitmap, %u in gd; " | 755 | "block bitmap and bg descriptor " |
| 756 | "block bitmap corrupt.", | 756 | "inconsistent: %u vs %u free clusters", |
| 757 | free, grp->bb_free); | 757 | free, grp->bb_free); |
| 758 | /* | 758 | /* |
| 759 | * If we intend to continue, we consider group descriptor | 759 | * If we intend to continue, we consider group descriptor |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index b9b9aabfb4d2..6df7bc611dbd 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -1525,8 +1525,6 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token, | |||
| 1525 | arg = JBD2_DEFAULT_MAX_COMMIT_AGE; | 1525 | arg = JBD2_DEFAULT_MAX_COMMIT_AGE; |
| 1526 | sbi->s_commit_interval = HZ * arg; | 1526 | sbi->s_commit_interval = HZ * arg; |
| 1527 | } else if (token == Opt_max_batch_time) { | 1527 | } else if (token == Opt_max_batch_time) { |
| 1528 | if (arg == 0) | ||
| 1529 | arg = EXT4_DEF_MAX_BATCH_TIME; | ||
| 1530 | sbi->s_max_batch_time = arg; | 1528 | sbi->s_max_batch_time = arg; |
| 1531 | } else if (token == Opt_min_batch_time) { | 1529 | } else if (token == Opt_min_batch_time) { |
| 1532 | sbi->s_min_batch_time = arg; | 1530 | sbi->s_min_batch_time = arg; |
| @@ -2809,10 +2807,11 @@ static void print_daily_error_info(unsigned long arg) | |||
| 2809 | es = sbi->s_es; | 2807 | es = sbi->s_es; |
| 2810 | 2808 | ||
| 2811 | if (es->s_error_count) | 2809 | if (es->s_error_count) |
| 2812 | ext4_msg(sb, KERN_NOTICE, "error count: %u", | 2810 | /* fsck newer than v1.41.13 is needed to clean this condition. */ |
| 2811 | ext4_msg(sb, KERN_NOTICE, "error count since last fsck: %u", | ||
| 2813 | le32_to_cpu(es->s_error_count)); | 2812 | le32_to_cpu(es->s_error_count)); |
| 2814 | if (es->s_first_error_time) { | 2813 | if (es->s_first_error_time) { |
| 2815 | printk(KERN_NOTICE "EXT4-fs (%s): initial error at %u: %.*s:%d", | 2814 | printk(KERN_NOTICE "EXT4-fs (%s): initial error at time %u: %.*s:%d", |
| 2816 | sb->s_id, le32_to_cpu(es->s_first_error_time), | 2815 | sb->s_id, le32_to_cpu(es->s_first_error_time), |
| 2817 | (int) sizeof(es->s_first_error_func), | 2816 | (int) sizeof(es->s_first_error_func), |
| 2818 | es->s_first_error_func, | 2817 | es->s_first_error_func, |
| @@ -2826,7 +2825,7 @@ static void print_daily_error_info(unsigned long arg) | |||
| 2826 | printk("\n"); | 2825 | printk("\n"); |
| 2827 | } | 2826 | } |
| 2828 | if (es->s_last_error_time) { | 2827 | if (es->s_last_error_time) { |
| 2829 | printk(KERN_NOTICE "EXT4-fs (%s): last error at %u: %.*s:%d", | 2828 | printk(KERN_NOTICE "EXT4-fs (%s): last error at time %u: %.*s:%d", |
| 2830 | sb->s_id, le32_to_cpu(es->s_last_error_time), | 2829 | sb->s_id, le32_to_cpu(es->s_last_error_time), |
| 2831 | (int) sizeof(es->s_last_error_func), | 2830 | (int) sizeof(es->s_last_error_func), |
| 2832 | es->s_last_error_func, | 2831 | es->s_last_error_func, |
| @@ -3880,38 +3879,19 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 3880 | goto failed_mount2; | 3879 | goto failed_mount2; |
| 3881 | } | 3880 | } |
| 3882 | } | 3881 | } |
| 3883 | |||
| 3884 | /* | ||
| 3885 | * set up enough so that it can read an inode, | ||
| 3886 | * and create new inode for buddy allocator | ||
| 3887 | */ | ||
| 3888 | sbi->s_gdb_count = db_count; | ||
| 3889 | if (!test_opt(sb, NOLOAD) && | ||
| 3890 | EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) | ||
| 3891 | sb->s_op = &ext4_sops; | ||
| 3892 | else | ||
| 3893 | sb->s_op = &ext4_nojournal_sops; | ||
| 3894 | |||
| 3895 | ext4_ext_init(sb); | ||
| 3896 | err = ext4_mb_init(sb); | ||
| 3897 | if (err) { | ||
| 3898 | ext4_msg(sb, KERN_ERR, "failed to initialize mballoc (%d)", | ||
| 3899 | err); | ||
| 3900 | goto failed_mount2; | ||
| 3901 | } | ||
| 3902 | |||
| 3903 | if (!ext4_check_descriptors(sb, &first_not_zeroed)) { | 3882 | if (!ext4_check_descriptors(sb, &first_not_zeroed)) { |
| 3904 | ext4_msg(sb, KERN_ERR, "group descriptors corrupted!"); | 3883 | ext4_msg(sb, KERN_ERR, "group descriptors corrupted!"); |
| 3905 | goto failed_mount2a; | 3884 | goto failed_mount2; |
| 3906 | } | 3885 | } |
| 3907 | if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) | 3886 | if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) |
| 3908 | if (!ext4_fill_flex_info(sb)) { | 3887 | if (!ext4_fill_flex_info(sb)) { |
| 3909 | ext4_msg(sb, KERN_ERR, | 3888 | ext4_msg(sb, KERN_ERR, |
| 3910 | "unable to initialize " | 3889 | "unable to initialize " |
| 3911 | "flex_bg meta info!"); | 3890 | "flex_bg meta info!"); |
| 3912 | goto failed_mount2a; | 3891 | goto failed_mount2; |
| 3913 | } | 3892 | } |
| 3914 | 3893 | ||
| 3894 | sbi->s_gdb_count = db_count; | ||
| 3915 | get_random_bytes(&sbi->s_next_generation, sizeof(u32)); | 3895 | get_random_bytes(&sbi->s_next_generation, sizeof(u32)); |
| 3916 | spin_lock_init(&sbi->s_next_gen_lock); | 3896 | spin_lock_init(&sbi->s_next_gen_lock); |
| 3917 | 3897 | ||
| @@ -3946,6 +3926,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 3946 | sbi->s_stripe = ext4_get_stripe_size(sbi); | 3926 | sbi->s_stripe = ext4_get_stripe_size(sbi); |
| 3947 | sbi->s_extent_max_zeroout_kb = 32; | 3927 | sbi->s_extent_max_zeroout_kb = 32; |
| 3948 | 3928 | ||
| 3929 | /* | ||
| 3930 | * set up enough so that it can read an inode | ||
| 3931 | */ | ||
| 3932 | if (!test_opt(sb, NOLOAD) && | ||
| 3933 | EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) | ||
| 3934 | sb->s_op = &ext4_sops; | ||
| 3935 | else | ||
| 3936 | sb->s_op = &ext4_nojournal_sops; | ||
| 3949 | sb->s_export_op = &ext4_export_ops; | 3937 | sb->s_export_op = &ext4_export_ops; |
| 3950 | sb->s_xattr = ext4_xattr_handlers; | 3938 | sb->s_xattr = ext4_xattr_handlers; |
| 3951 | #ifdef CONFIG_QUOTA | 3939 | #ifdef CONFIG_QUOTA |
| @@ -4135,13 +4123,21 @@ no_journal: | |||
| 4135 | if (err) { | 4123 | if (err) { |
| 4136 | ext4_msg(sb, KERN_ERR, "failed to reserve %llu clusters for " | 4124 | ext4_msg(sb, KERN_ERR, "failed to reserve %llu clusters for " |
| 4137 | "reserved pool", ext4_calculate_resv_clusters(sb)); | 4125 | "reserved pool", ext4_calculate_resv_clusters(sb)); |
| 4138 | goto failed_mount5; | 4126 | goto failed_mount4a; |
| 4139 | } | 4127 | } |
| 4140 | 4128 | ||
| 4141 | err = ext4_setup_system_zone(sb); | 4129 | err = ext4_setup_system_zone(sb); |
| 4142 | if (err) { | 4130 | if (err) { |
| 4143 | ext4_msg(sb, KERN_ERR, "failed to initialize system " | 4131 | ext4_msg(sb, KERN_ERR, "failed to initialize system " |
| 4144 | "zone (%d)", err); | 4132 | "zone (%d)", err); |
| 4133 | goto failed_mount4a; | ||
| 4134 | } | ||
| 4135 | |||
| 4136 | ext4_ext_init(sb); | ||
| 4137 | err = ext4_mb_init(sb); | ||
| 4138 | if (err) { | ||
| 4139 | ext4_msg(sb, KERN_ERR, "failed to initialize mballoc (%d)", | ||
| 4140 | err); | ||
| 4145 | goto failed_mount5; | 4141 | goto failed_mount5; |
| 4146 | } | 4142 | } |
| 4147 | 4143 | ||
| @@ -4218,8 +4214,11 @@ failed_mount8: | |||
| 4218 | failed_mount7: | 4214 | failed_mount7: |
| 4219 | ext4_unregister_li_request(sb); | 4215 | ext4_unregister_li_request(sb); |
| 4220 | failed_mount6: | 4216 | failed_mount6: |
| 4221 | ext4_release_system_zone(sb); | 4217 | ext4_mb_release(sb); |
| 4222 | failed_mount5: | 4218 | failed_mount5: |
| 4219 | ext4_ext_release(sb); | ||
| 4220 | ext4_release_system_zone(sb); | ||
| 4221 | failed_mount4a: | ||
| 4223 | dput(sb->s_root); | 4222 | dput(sb->s_root); |
| 4224 | sb->s_root = NULL; | 4223 | sb->s_root = NULL; |
| 4225 | failed_mount4: | 4224 | failed_mount4: |
| @@ -4243,14 +4242,11 @@ failed_mount3: | |||
| 4243 | percpu_counter_destroy(&sbi->s_extent_cache_cnt); | 4242 | percpu_counter_destroy(&sbi->s_extent_cache_cnt); |
| 4244 | if (sbi->s_mmp_tsk) | 4243 | if (sbi->s_mmp_tsk) |
| 4245 | kthread_stop(sbi->s_mmp_tsk); | 4244 | kthread_stop(sbi->s_mmp_tsk); |
| 4246 | failed_mount2a: | ||
| 4247 | ext4_mb_release(sb); | ||
| 4248 | failed_mount2: | 4245 | failed_mount2: |
| 4249 | for (i = 0; i < db_count; i++) | 4246 | for (i = 0; i < db_count; i++) |
| 4250 | brelse(sbi->s_group_desc[i]); | 4247 | brelse(sbi->s_group_desc[i]); |
| 4251 | ext4_kvfree(sbi->s_group_desc); | 4248 | ext4_kvfree(sbi->s_group_desc); |
| 4252 | failed_mount: | 4249 | failed_mount: |
| 4253 | ext4_ext_release(sb); | ||
| 4254 | if (sbi->s_chksum_driver) | 4250 | if (sbi->s_chksum_driver) |
| 4255 | crypto_free_shash(sbi->s_chksum_driver); | 4251 | crypto_free_shash(sbi->s_chksum_driver); |
| 4256 | if (sbi->s_proc) { | 4252 | if (sbi->s_proc) { |
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 0924521306b4..f8cf619edb5f 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
| @@ -608,8 +608,8 @@ static int __allocate_data_block(struct dnode_of_data *dn) | |||
| 608 | * b. do not use extent cache for better performance | 608 | * b. do not use extent cache for better performance |
| 609 | * c. give the block addresses to blockdev | 609 | * c. give the block addresses to blockdev |
| 610 | */ | 610 | */ |
| 611 | static int get_data_block(struct inode *inode, sector_t iblock, | 611 | static int __get_data_block(struct inode *inode, sector_t iblock, |
| 612 | struct buffer_head *bh_result, int create) | 612 | struct buffer_head *bh_result, int create, bool fiemap) |
| 613 | { | 613 | { |
| 614 | struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); | 614 | struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); |
| 615 | unsigned int blkbits = inode->i_sb->s_blocksize_bits; | 615 | unsigned int blkbits = inode->i_sb->s_blocksize_bits; |
| @@ -637,7 +637,7 @@ static int get_data_block(struct inode *inode, sector_t iblock, | |||
| 637 | err = 0; | 637 | err = 0; |
| 638 | goto unlock_out; | 638 | goto unlock_out; |
| 639 | } | 639 | } |
| 640 | if (dn.data_blkaddr == NEW_ADDR) | 640 | if (dn.data_blkaddr == NEW_ADDR && !fiemap) |
| 641 | goto put_out; | 641 | goto put_out; |
| 642 | 642 | ||
| 643 | if (dn.data_blkaddr != NULL_ADDR) { | 643 | if (dn.data_blkaddr != NULL_ADDR) { |
| @@ -671,7 +671,7 @@ get_next: | |||
| 671 | err = 0; | 671 | err = 0; |
| 672 | goto unlock_out; | 672 | goto unlock_out; |
| 673 | } | 673 | } |
| 674 | if (dn.data_blkaddr == NEW_ADDR) | 674 | if (dn.data_blkaddr == NEW_ADDR && !fiemap) |
| 675 | goto put_out; | 675 | goto put_out; |
| 676 | 676 | ||
| 677 | end_offset = ADDRS_PER_PAGE(dn.node_page, F2FS_I(inode)); | 677 | end_offset = ADDRS_PER_PAGE(dn.node_page, F2FS_I(inode)); |
| @@ -708,10 +708,23 @@ out: | |||
| 708 | return err; | 708 | return err; |
| 709 | } | 709 | } |
| 710 | 710 | ||
| 711 | static int get_data_block(struct inode *inode, sector_t iblock, | ||
| 712 | struct buffer_head *bh_result, int create) | ||
| 713 | { | ||
| 714 | return __get_data_block(inode, iblock, bh_result, create, false); | ||
| 715 | } | ||
| 716 | |||
| 717 | static int get_data_block_fiemap(struct inode *inode, sector_t iblock, | ||
| 718 | struct buffer_head *bh_result, int create) | ||
| 719 | { | ||
| 720 | return __get_data_block(inode, iblock, bh_result, create, true); | ||
| 721 | } | ||
| 722 | |||
| 711 | int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | 723 | int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, |
| 712 | u64 start, u64 len) | 724 | u64 start, u64 len) |
| 713 | { | 725 | { |
| 714 | return generic_block_fiemap(inode, fieinfo, start, len, get_data_block); | 726 | return generic_block_fiemap(inode, fieinfo, |
| 727 | start, len, get_data_block_fiemap); | ||
| 715 | } | 728 | } |
| 716 | 729 | ||
| 717 | static int f2fs_read_data_page(struct file *file, struct page *page) | 730 | static int f2fs_read_data_page(struct file *file, struct page *page) |
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 966acb039e3b..a4addd72ebbd 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c | |||
| @@ -376,11 +376,11 @@ static struct page *init_inode_metadata(struct inode *inode, | |||
| 376 | 376 | ||
| 377 | put_error: | 377 | put_error: |
| 378 | f2fs_put_page(page, 1); | 378 | f2fs_put_page(page, 1); |
| 379 | error: | ||
| 379 | /* once the failed inode becomes a bad inode, i_mode is S_IFREG */ | 380 | /* once the failed inode becomes a bad inode, i_mode is S_IFREG */ |
| 380 | truncate_inode_pages(&inode->i_data, 0); | 381 | truncate_inode_pages(&inode->i_data, 0); |
| 381 | truncate_blocks(inode, 0); | 382 | truncate_blocks(inode, 0); |
| 382 | remove_dirty_dir_inode(inode); | 383 | remove_dirty_dir_inode(inode); |
| 383 | error: | ||
| 384 | remove_inode_page(inode); | 384 | remove_inode_page(inode); |
| 385 | return ERR_PTR(err); | 385 | return ERR_PTR(err); |
| 386 | } | 386 | } |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index e51c732b0dd9..58df97e174d0 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
| @@ -342,9 +342,6 @@ struct f2fs_sm_info { | |||
| 342 | struct dirty_seglist_info *dirty_info; /* dirty segment information */ | 342 | struct dirty_seglist_info *dirty_info; /* dirty segment information */ |
| 343 | struct curseg_info *curseg_array; /* active segment information */ | 343 | struct curseg_info *curseg_array; /* active segment information */ |
| 344 | 344 | ||
| 345 | struct list_head wblist_head; /* list of under-writeback pages */ | ||
| 346 | spinlock_t wblist_lock; /* lock for checkpoint */ | ||
| 347 | |||
| 348 | block_t seg0_blkaddr; /* block address of 0'th segment */ | 345 | block_t seg0_blkaddr; /* block address of 0'th segment */ |
| 349 | block_t main_blkaddr; /* start block address of main area */ | 346 | block_t main_blkaddr; /* start block address of main area */ |
| 350 | block_t ssa_blkaddr; /* start block address of SSA area */ | 347 | block_t ssa_blkaddr; /* start block address of SSA area */ |
| @@ -644,7 +641,8 @@ static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi) | |||
| 644 | */ | 641 | */ |
| 645 | static inline int check_nid_range(struct f2fs_sb_info *sbi, nid_t nid) | 642 | static inline int check_nid_range(struct f2fs_sb_info *sbi, nid_t nid) |
| 646 | { | 643 | { |
| 647 | WARN_ON((nid >= NM_I(sbi)->max_nid)); | 644 | if (unlikely(nid < F2FS_ROOT_INO(sbi))) |
| 645 | return -EINVAL; | ||
| 648 | if (unlikely(nid >= NM_I(sbi)->max_nid)) | 646 | if (unlikely(nid >= NM_I(sbi)->max_nid)) |
| 649 | return -EINVAL; | 647 | return -EINVAL; |
| 650 | return 0; | 648 | return 0; |
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index c58e33075719..7d8b96275092 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c | |||
| @@ -659,16 +659,19 @@ static int expand_inode_data(struct inode *inode, loff_t offset, | |||
| 659 | off_start = offset & (PAGE_CACHE_SIZE - 1); | 659 | off_start = offset & (PAGE_CACHE_SIZE - 1); |
| 660 | off_end = (offset + len) & (PAGE_CACHE_SIZE - 1); | 660 | off_end = (offset + len) & (PAGE_CACHE_SIZE - 1); |
| 661 | 661 | ||
| 662 | f2fs_lock_op(sbi); | ||
| 663 | |||
| 662 | for (index = pg_start; index <= pg_end; index++) { | 664 | for (index = pg_start; index <= pg_end; index++) { |
| 663 | struct dnode_of_data dn; | 665 | struct dnode_of_data dn; |
| 664 | 666 | ||
| 665 | f2fs_lock_op(sbi); | 667 | if (index == pg_end && !off_end) |
| 668 | goto noalloc; | ||
| 669 | |||
| 666 | set_new_dnode(&dn, inode, NULL, NULL, 0); | 670 | set_new_dnode(&dn, inode, NULL, NULL, 0); |
| 667 | ret = f2fs_reserve_block(&dn, index); | 671 | ret = f2fs_reserve_block(&dn, index); |
| 668 | f2fs_unlock_op(sbi); | ||
| 669 | if (ret) | 672 | if (ret) |
| 670 | break; | 673 | break; |
| 671 | 674 | noalloc: | |
| 672 | if (pg_start == pg_end) | 675 | if (pg_start == pg_end) |
| 673 | new_size = offset + len; | 676 | new_size = offset + len; |
| 674 | else if (index == pg_start && off_start) | 677 | else if (index == pg_start && off_start) |
| @@ -683,8 +686,9 @@ static int expand_inode_data(struct inode *inode, loff_t offset, | |||
| 683 | i_size_read(inode) < new_size) { | 686 | i_size_read(inode) < new_size) { |
| 684 | i_size_write(inode, new_size); | 687 | i_size_write(inode, new_size); |
| 685 | mark_inode_dirty(inode); | 688 | mark_inode_dirty(inode); |
| 686 | f2fs_write_inode(inode, NULL); | 689 | update_inode_page(inode); |
| 687 | } | 690 | } |
| 691 | f2fs_unlock_op(sbi); | ||
| 688 | 692 | ||
| 689 | return ret; | 693 | return ret; |
| 690 | } | 694 | } |
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index adc622c6bdce..2cf6962f6cc8 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c | |||
| @@ -78,6 +78,7 @@ static int do_read_inode(struct inode *inode) | |||
| 78 | if (check_nid_range(sbi, inode->i_ino)) { | 78 | if (check_nid_range(sbi, inode->i_ino)) { |
| 79 | f2fs_msg(inode->i_sb, KERN_ERR, "bad inode number: %lu", | 79 | f2fs_msg(inode->i_sb, KERN_ERR, "bad inode number: %lu", |
| 80 | (unsigned long) inode->i_ino); | 80 | (unsigned long) inode->i_ino); |
| 81 | WARN_ON(1); | ||
| 81 | return -EINVAL; | 82 | return -EINVAL; |
| 82 | } | 83 | } |
| 83 | 84 | ||
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 9138c32aa698..a6bdddc33ce2 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c | |||
| @@ -417,9 +417,6 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | f2fs_set_link(new_dir, new_entry, new_page, old_inode); | 419 | f2fs_set_link(new_dir, new_entry, new_page, old_inode); |
| 420 | down_write(&F2FS_I(old_inode)->i_sem); | ||
| 421 | F2FS_I(old_inode)->i_pino = new_dir->i_ino; | ||
| 422 | up_write(&F2FS_I(old_inode)->i_sem); | ||
| 423 | 420 | ||
| 424 | new_inode->i_ctime = CURRENT_TIME; | 421 | new_inode->i_ctime = CURRENT_TIME; |
| 425 | down_write(&F2FS_I(new_inode)->i_sem); | 422 | down_write(&F2FS_I(new_inode)->i_sem); |
| @@ -448,6 +445,10 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
| 448 | } | 445 | } |
| 449 | } | 446 | } |
| 450 | 447 | ||
| 448 | down_write(&F2FS_I(old_inode)->i_sem); | ||
| 449 | file_lost_pino(old_inode); | ||
| 450 | up_write(&F2FS_I(old_inode)->i_sem); | ||
| 451 | |||
| 451 | old_inode->i_ctime = CURRENT_TIME; | 452 | old_inode->i_ctime = CURRENT_TIME; |
| 452 | mark_inode_dirty(old_inode); | 453 | mark_inode_dirty(old_inode); |
| 453 | 454 | ||
| @@ -457,9 +458,6 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
| 457 | if (old_dir != new_dir) { | 458 | if (old_dir != new_dir) { |
| 458 | f2fs_set_link(old_inode, old_dir_entry, | 459 | f2fs_set_link(old_inode, old_dir_entry, |
| 459 | old_dir_page, new_dir); | 460 | old_dir_page, new_dir); |
| 460 | down_write(&F2FS_I(old_inode)->i_sem); | ||
| 461 | F2FS_I(old_inode)->i_pino = new_dir->i_ino; | ||
| 462 | up_write(&F2FS_I(old_inode)->i_sem); | ||
| 463 | update_inode_page(old_inode); | 461 | update_inode_page(old_inode); |
| 464 | } else { | 462 | } else { |
| 465 | kunmap(old_dir_page); | 463 | kunmap(old_dir_page); |
| @@ -474,7 +472,8 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
| 474 | return 0; | 472 | return 0; |
| 475 | 473 | ||
| 476 | put_out_dir: | 474 | put_out_dir: |
| 477 | f2fs_put_page(new_page, 1); | 475 | kunmap(new_page); |
| 476 | f2fs_put_page(new_page, 0); | ||
| 478 | out_dir: | 477 | out_dir: |
| 479 | if (old_dir_entry) { | 478 | if (old_dir_entry) { |
| 480 | kunmap(old_dir_page); | 479 | kunmap(old_dir_page); |
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 9dfb9a042fd2..4b697ccc9b0c 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c | |||
| @@ -42,6 +42,8 @@ bool available_free_memory(struct f2fs_sb_info *sbi, int type) | |||
| 42 | mem_size = (nm_i->nat_cnt * sizeof(struct nat_entry)) >> 12; | 42 | mem_size = (nm_i->nat_cnt * sizeof(struct nat_entry)) >> 12; |
| 43 | res = mem_size < ((val.totalram * nm_i->ram_thresh / 100) >> 2); | 43 | res = mem_size < ((val.totalram * nm_i->ram_thresh / 100) >> 2); |
| 44 | } else if (type == DIRTY_DENTS) { | 44 | } else if (type == DIRTY_DENTS) { |
| 45 | if (sbi->sb->s_bdi->dirty_exceeded) | ||
| 46 | return false; | ||
| 45 | mem_size = get_pages(sbi, F2FS_DIRTY_DENTS); | 47 | mem_size = get_pages(sbi, F2FS_DIRTY_DENTS); |
| 46 | res = mem_size < ((val.totalram * nm_i->ram_thresh / 100) >> 1); | 48 | res = mem_size < ((val.totalram * nm_i->ram_thresh / 100) >> 1); |
| 47 | } | 49 | } |
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index f25f0e07e26f..d04613df710a 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c | |||
| @@ -272,14 +272,15 @@ int create_flush_cmd_control(struct f2fs_sb_info *sbi) | |||
| 272 | return -ENOMEM; | 272 | return -ENOMEM; |
| 273 | spin_lock_init(&fcc->issue_lock); | 273 | spin_lock_init(&fcc->issue_lock); |
| 274 | init_waitqueue_head(&fcc->flush_wait_queue); | 274 | init_waitqueue_head(&fcc->flush_wait_queue); |
| 275 | sbi->sm_info->cmd_control_info = fcc; | ||
| 275 | fcc->f2fs_issue_flush = kthread_run(issue_flush_thread, sbi, | 276 | fcc->f2fs_issue_flush = kthread_run(issue_flush_thread, sbi, |
| 276 | "f2fs_flush-%u:%u", MAJOR(dev), MINOR(dev)); | 277 | "f2fs_flush-%u:%u", MAJOR(dev), MINOR(dev)); |
| 277 | if (IS_ERR(fcc->f2fs_issue_flush)) { | 278 | if (IS_ERR(fcc->f2fs_issue_flush)) { |
| 278 | err = PTR_ERR(fcc->f2fs_issue_flush); | 279 | err = PTR_ERR(fcc->f2fs_issue_flush); |
| 279 | kfree(fcc); | 280 | kfree(fcc); |
| 281 | sbi->sm_info->cmd_control_info = NULL; | ||
| 280 | return err; | 282 | return err; |
| 281 | } | 283 | } |
| 282 | sbi->sm_info->cmd_control_info = fcc; | ||
| 283 | 284 | ||
| 284 | return err; | 285 | return err; |
| 285 | } | 286 | } |
| @@ -1885,8 +1886,6 @@ int build_segment_manager(struct f2fs_sb_info *sbi) | |||
| 1885 | 1886 | ||
| 1886 | /* init sm info */ | 1887 | /* init sm info */ |
| 1887 | sbi->sm_info = sm_info; | 1888 | sbi->sm_info = sm_info; |
| 1888 | INIT_LIST_HEAD(&sm_info->wblist_head); | ||
| 1889 | spin_lock_init(&sm_info->wblist_lock); | ||
| 1890 | sm_info->seg0_blkaddr = le32_to_cpu(raw_super->segment0_blkaddr); | 1889 | sm_info->seg0_blkaddr = le32_to_cpu(raw_super->segment0_blkaddr); |
| 1891 | sm_info->main_blkaddr = le32_to_cpu(raw_super->main_blkaddr); | 1890 | sm_info->main_blkaddr = le32_to_cpu(raw_super->main_blkaddr); |
| 1892 | sm_info->segment_count = le32_to_cpu(raw_super->segment_count); | 1891 | sm_info->segment_count = le32_to_cpu(raw_super->segment_count); |
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index b2b18637cb9e..8f96d9372ade 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
| @@ -689,9 +689,7 @@ static struct inode *f2fs_nfs_get_inode(struct super_block *sb, | |||
| 689 | struct f2fs_sb_info *sbi = F2FS_SB(sb); | 689 | struct f2fs_sb_info *sbi = F2FS_SB(sb); |
| 690 | struct inode *inode; | 690 | struct inode *inode; |
| 691 | 691 | ||
| 692 | if (unlikely(ino < F2FS_ROOT_INO(sbi))) | 692 | if (check_nid_range(sbi, ino)) |
| 693 | return ERR_PTR(-ESTALE); | ||
| 694 | if (unlikely(ino >= NM_I(sbi)->max_nid)) | ||
| 695 | return ERR_PTR(-ESTALE); | 693 | return ERR_PTR(-ESTALE); |
| 696 | 694 | ||
| 697 | /* | 695 | /* |
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index 38cfcf5f6fce..6f0f590cc5a3 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
| @@ -1588,9 +1588,12 @@ int jbd2_journal_stop(handle_t *handle) | |||
| 1588 | * to perform a synchronous write. We do this to detect the | 1588 | * to perform a synchronous write. We do this to detect the |
| 1589 | * case where a single process is doing a stream of sync | 1589 | * case where a single process is doing a stream of sync |
| 1590 | * writes. No point in waiting for joiners in that case. | 1590 | * writes. No point in waiting for joiners in that case. |
| 1591 | * | ||
| 1592 | * Setting max_batch_time to 0 disables this completely. | ||
| 1591 | */ | 1593 | */ |
| 1592 | pid = current->pid; | 1594 | pid = current->pid; |
| 1593 | if (handle->h_sync && journal->j_last_sync_writer != pid) { | 1595 | if (handle->h_sync && journal->j_last_sync_writer != pid && |
| 1596 | journal->j_max_batch_time) { | ||
| 1594 | u64 commit_time, trans_time; | 1597 | u64 commit_time, trans_time; |
| 1595 | 1598 | ||
| 1596 | journal->j_last_sync_writer = pid; | 1599 | journal->j_last_sync_writer = pid; |
diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c index d171b98a6cdd..f973ae9b05f1 100644 --- a/fs/kernfs/mount.c +++ b/fs/kernfs/mount.c | |||
| @@ -211,6 +211,36 @@ void kernfs_kill_sb(struct super_block *sb) | |||
| 211 | kernfs_put(root_kn); | 211 | kernfs_put(root_kn); |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | /** | ||
| 215 | * kernfs_pin_sb: try to pin the superblock associated with a kernfs_root | ||
| 216 | * @kernfs_root: the kernfs_root in question | ||
| 217 | * @ns: the namespace tag | ||
| 218 | * | ||
| 219 | * Pin the superblock so the superblock won't be destroyed in subsequent | ||
| 220 | * operations. This can be used to block ->kill_sb() which may be useful | ||
| 221 | * for kernfs users which dynamically manage superblocks. | ||
| 222 | * | ||
| 223 | * Returns NULL if there's no superblock associated to this kernfs_root, or | ||
| 224 | * -EINVAL if the superblock is being freed. | ||
| 225 | */ | ||
| 226 | struct super_block *kernfs_pin_sb(struct kernfs_root *root, const void *ns) | ||
| 227 | { | ||
| 228 | struct kernfs_super_info *info; | ||
| 229 | struct super_block *sb = NULL; | ||
| 230 | |||
| 231 | mutex_lock(&kernfs_mutex); | ||
| 232 | list_for_each_entry(info, &root->supers, node) { | ||
| 233 | if (info->ns == ns) { | ||
| 234 | sb = info->sb; | ||
| 235 | if (!atomic_inc_not_zero(&info->sb->s_active)) | ||
| 236 | sb = ERR_PTR(-EINVAL); | ||
| 237 | break; | ||
| 238 | } | ||
| 239 | } | ||
| 240 | mutex_unlock(&kernfs_mutex); | ||
| 241 | return sb; | ||
| 242 | } | ||
| 243 | |||
| 214 | void __init kernfs_init(void) | 244 | void __init kernfs_init(void) |
| 215 | { | 245 | { |
| 216 | kernfs_node_cache = kmem_cache_create("kernfs_node_cache", | 246 | kernfs_node_cache = kmem_cache_create("kernfs_node_cache", |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 2fc7abebeb9b..b56b1cc02718 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
| @@ -2641,7 +2641,7 @@ nfsd4_encode_rdattr_error(struct xdr_stream *xdr, __be32 nfserr) | |||
| 2641 | { | 2641 | { |
| 2642 | __be32 *p; | 2642 | __be32 *p; |
| 2643 | 2643 | ||
| 2644 | p = xdr_reserve_space(xdr, 6); | 2644 | p = xdr_reserve_space(xdr, 20); |
| 2645 | if (!p) | 2645 | if (!p) |
| 2646 | return NULL; | 2646 | return NULL; |
| 2647 | *p++ = htonl(2); | 2647 | *p++ = htonl(2); |
diff --git a/include/acpi/video.h b/include/acpi/video.h index ea4c7bbded4d..843ef1adfbfa 100644 --- a/include/acpi/video.h +++ b/include/acpi/video.h | |||
| @@ -22,6 +22,7 @@ extern void acpi_video_unregister(void); | |||
| 22 | extern void acpi_video_unregister_backlight(void); | 22 | extern void acpi_video_unregister_backlight(void); |
| 23 | extern int acpi_video_get_edid(struct acpi_device *device, int type, | 23 | extern int acpi_video_get_edid(struct acpi_device *device, int type, |
| 24 | int device_id, void **edid); | 24 | int device_id, void **edid); |
| 25 | extern bool acpi_video_verify_backlight_support(void); | ||
| 25 | #else | 26 | #else |
| 26 | static inline int acpi_video_register(void) { return 0; } | 27 | static inline int acpi_video_register(void) { return 0; } |
| 27 | static inline void acpi_video_unregister(void) { return; } | 28 | static inline void acpi_video_unregister(void) { return; } |
| @@ -31,6 +32,7 @@ static inline int acpi_video_get_edid(struct acpi_device *device, int type, | |||
| 31 | { | 32 | { |
| 32 | return -ENODEV; | 33 | return -ENODEV; |
| 33 | } | 34 | } |
| 35 | static inline bool acpi_video_verify_backlight_support(void) { return false; } | ||
| 34 | #endif | 36 | #endif |
| 35 | 37 | ||
| 36 | #endif | 38 | #endif |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 471ba48c7ae4..c1c0b0cf39b4 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
| @@ -693,7 +693,7 @@ | |||
| 693 | . = ALIGN(PAGE_SIZE); \ | 693 | . = ALIGN(PAGE_SIZE); \ |
| 694 | *(.data..percpu..page_aligned) \ | 694 | *(.data..percpu..page_aligned) \ |
| 695 | . = ALIGN(cacheline); \ | 695 | . = ALIGN(cacheline); \ |
| 696 | *(.data..percpu..readmostly) \ | 696 | *(.data..percpu..read_mostly) \ |
| 697 | . = ALIGN(cacheline); \ | 697 | . = ALIGN(cacheline); \ |
| 698 | *(.data..percpu) \ | 698 | *(.data..percpu) \ |
| 699 | *(.data..percpu..shared_aligned) \ | 699 | *(.data..percpu..shared_aligned) \ |
diff --git a/include/dt-bindings/clock/exynos5420.h b/include/dt-bindings/clock/exynos5420.h index 97dcb89d37d3..21d51ae1d242 100644 --- a/include/dt-bindings/clock/exynos5420.h +++ b/include/dt-bindings/clock/exynos5420.h | |||
| @@ -63,7 +63,6 @@ | |||
| 63 | #define CLK_SCLK_MPHY_IXTAL24 161 | 63 | #define CLK_SCLK_MPHY_IXTAL24 161 |
| 64 | 64 | ||
| 65 | /* gate clocks */ | 65 | /* gate clocks */ |
| 66 | #define CLK_ACLK66_PERIC 256 | ||
| 67 | #define CLK_UART0 257 | 66 | #define CLK_UART0 257 |
| 68 | #define CLK_UART1 258 | 67 | #define CLK_UART1 258 |
| 69 | #define CLK_UART2 259 | 68 | #define CLK_UART2 259 |
| @@ -203,6 +202,8 @@ | |||
| 203 | #define CLK_MOUT_G3D 641 | 202 | #define CLK_MOUT_G3D 641 |
| 204 | #define CLK_MOUT_VPLL 642 | 203 | #define CLK_MOUT_VPLL 642 |
| 205 | #define CLK_MOUT_MAUDIO0 643 | 204 | #define CLK_MOUT_MAUDIO0 643 |
| 205 | #define CLK_MOUT_USER_ACLK333 644 | ||
| 206 | #define CLK_MOUT_SW_ACLK333 645 | ||
| 206 | 207 | ||
| 207 | /* divider clocks */ | 208 | /* divider clocks */ |
| 208 | #define CLK_DOUT_PIXEL 768 | 209 | #define CLK_DOUT_PIXEL 768 |
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index 145375ea0bd9..30faf797c2c3 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h | |||
| @@ -305,6 +305,7 @@ struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, | |||
| 305 | struct kernfs_root *root, unsigned long magic, | 305 | struct kernfs_root *root, unsigned long magic, |
| 306 | bool *new_sb_created, const void *ns); | 306 | bool *new_sb_created, const void *ns); |
| 307 | void kernfs_kill_sb(struct super_block *sb); | 307 | void kernfs_kill_sb(struct super_block *sb); |
| 308 | struct super_block *kernfs_pin_sb(struct kernfs_root *root, const void *ns); | ||
| 308 | 309 | ||
| 309 | void kernfs_init(void); | 310 | void kernfs_init(void); |
| 310 | 311 | ||
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index a5fc7d01aad6..dec01d6c3f80 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
| @@ -146,10 +146,10 @@ | |||
| 146 | * Declaration/definition used for per-CPU variables that must be read mostly. | 146 | * Declaration/definition used for per-CPU variables that must be read mostly. |
| 147 | */ | 147 | */ |
| 148 | #define DECLARE_PER_CPU_READ_MOSTLY(type, name) \ | 148 | #define DECLARE_PER_CPU_READ_MOSTLY(type, name) \ |
| 149 | DECLARE_PER_CPU_SECTION(type, name, "..readmostly") | 149 | DECLARE_PER_CPU_SECTION(type, name, "..read_mostly") |
| 150 | 150 | ||
| 151 | #define DEFINE_PER_CPU_READ_MOSTLY(type, name) \ | 151 | #define DEFINE_PER_CPU_READ_MOSTLY(type, name) \ |
| 152 | DEFINE_PER_CPU_SECTION(type, name, "..readmostly") | 152 | DEFINE_PER_CPU_SECTION(type, name, "..read_mostly") |
| 153 | 153 | ||
| 154 | /* | 154 | /* |
| 155 | * Intermodule exports for per-CPU variables. sparse forgets about | 155 | * Intermodule exports for per-CPU variables. sparse forgets about |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 7868fc3c0bc5..70776aec2562 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
| @@ -1648,10 +1648,13 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type, | |||
| 1648 | int flags, const char *unused_dev_name, | 1648 | int flags, const char *unused_dev_name, |
| 1649 | void *data) | 1649 | void *data) |
| 1650 | { | 1650 | { |
| 1651 | struct super_block *pinned_sb = NULL; | ||
| 1652 | struct cgroup_subsys *ss; | ||
| 1651 | struct cgroup_root *root; | 1653 | struct cgroup_root *root; |
| 1652 | struct cgroup_sb_opts opts; | 1654 | struct cgroup_sb_opts opts; |
| 1653 | struct dentry *dentry; | 1655 | struct dentry *dentry; |
| 1654 | int ret; | 1656 | int ret; |
| 1657 | int i; | ||
| 1655 | bool new_sb; | 1658 | bool new_sb; |
| 1656 | 1659 | ||
| 1657 | /* | 1660 | /* |
| @@ -1677,6 +1680,27 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type, | |||
| 1677 | goto out_unlock; | 1680 | goto out_unlock; |
| 1678 | } | 1681 | } |
| 1679 | 1682 | ||
| 1683 | /* | ||
| 1684 | * Destruction of cgroup root is asynchronous, so subsystems may | ||
| 1685 | * still be dying after the previous unmount. Let's drain the | ||
| 1686 | * dying subsystems. We just need to ensure that the ones | ||
| 1687 | * unmounted previously finish dying and don't care about new ones | ||
| 1688 | * starting. Testing ref liveliness is good enough. | ||
| 1689 | */ | ||
| 1690 | for_each_subsys(ss, i) { | ||
| 1691 | if (!(opts.subsys_mask & (1 << i)) || | ||
| 1692 | ss->root == &cgrp_dfl_root) | ||
| 1693 | continue; | ||
| 1694 | |||
| 1695 | if (!percpu_ref_tryget_live(&ss->root->cgrp.self.refcnt)) { | ||
| 1696 | mutex_unlock(&cgroup_mutex); | ||
| 1697 | msleep(10); | ||
| 1698 | ret = restart_syscall(); | ||
| 1699 | goto out_free; | ||
| 1700 | } | ||
| 1701 | cgroup_put(&ss->root->cgrp); | ||
| 1702 | } | ||
| 1703 | |||
| 1680 | for_each_root(root) { | 1704 | for_each_root(root) { |
| 1681 | bool name_match = false; | 1705 | bool name_match = false; |
| 1682 | 1706 | ||
| @@ -1717,15 +1741,23 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type, | |||
| 1717 | } | 1741 | } |
| 1718 | 1742 | ||
| 1719 | /* | 1743 | /* |
| 1720 | * A root's lifetime is governed by its root cgroup. | 1744 | * We want to reuse @root whose lifetime is governed by its |
| 1721 | * tryget_live failure indicate that the root is being | 1745 | * ->cgrp. Let's check whether @root is alive and keep it |
| 1722 | * destroyed. Wait for destruction to complete so that the | 1746 | * that way. As cgroup_kill_sb() can happen anytime, we |
| 1723 | * subsystems are free. We can use wait_queue for the wait | 1747 | * want to block it by pinning the sb so that @root doesn't |
| 1724 | * but this path is super cold. Let's just sleep for a bit | 1748 | * get killed before mount is complete. |
| 1725 | * and retry. | 1749 | * |
| 1750 | * With the sb pinned, tryget_live can reliably indicate | ||
| 1751 | * whether @root can be reused. If it's being killed, | ||
| 1752 | * drain it. We can use wait_queue for the wait but this | ||
| 1753 | * path is super cold. Let's just sleep a bit and retry. | ||
| 1726 | */ | 1754 | */ |
| 1727 | if (!percpu_ref_tryget_live(&root->cgrp.self.refcnt)) { | 1755 | pinned_sb = kernfs_pin_sb(root->kf_root, NULL); |
| 1756 | if (IS_ERR(pinned_sb) || | ||
| 1757 | !percpu_ref_tryget_live(&root->cgrp.self.refcnt)) { | ||
| 1728 | mutex_unlock(&cgroup_mutex); | 1758 | mutex_unlock(&cgroup_mutex); |
| 1759 | if (!IS_ERR_OR_NULL(pinned_sb)) | ||
| 1760 | deactivate_super(pinned_sb); | ||
| 1729 | msleep(10); | 1761 | msleep(10); |
| 1730 | ret = restart_syscall(); | 1762 | ret = restart_syscall(); |
| 1731 | goto out_free; | 1763 | goto out_free; |
| @@ -1770,6 +1802,16 @@ out_free: | |||
| 1770 | CGROUP_SUPER_MAGIC, &new_sb); | 1802 | CGROUP_SUPER_MAGIC, &new_sb); |
| 1771 | if (IS_ERR(dentry) || !new_sb) | 1803 | if (IS_ERR(dentry) || !new_sb) |
| 1772 | cgroup_put(&root->cgrp); | 1804 | cgroup_put(&root->cgrp); |
| 1805 | |||
| 1806 | /* | ||
| 1807 | * If @pinned_sb, we're reusing an existing root and holding an | ||
| 1808 | * extra ref on its sb. Mount is complete. Put the extra ref. | ||
| 1809 | */ | ||
| 1810 | if (pinned_sb) { | ||
| 1811 | WARN_ON(new_sb); | ||
| 1812 | deactivate_super(pinned_sb); | ||
| 1813 | } | ||
| 1814 | |||
| 1773 | return dentry; | 1815 | return dentry; |
| 1774 | } | 1816 | } |
| 1775 | 1817 | ||
| @@ -3328,7 +3370,7 @@ bool css_has_online_children(struct cgroup_subsys_state *css) | |||
| 3328 | 3370 | ||
| 3329 | rcu_read_lock(); | 3371 | rcu_read_lock(); |
| 3330 | css_for_each_child(child, css) { | 3372 | css_for_each_child(child, css) { |
| 3331 | if (css->flags & CSS_ONLINE) { | 3373 | if (child->flags & CSS_ONLINE) { |
| 3332 | ret = true; | 3374 | ret = true; |
| 3333 | break; | 3375 | break; |
| 3334 | } | 3376 | } |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index f6b33c696224..116a4164720a 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
| @@ -1181,7 +1181,13 @@ done: | |||
| 1181 | 1181 | ||
| 1182 | int current_cpuset_is_being_rebound(void) | 1182 | int current_cpuset_is_being_rebound(void) |
| 1183 | { | 1183 | { |
| 1184 | return task_cs(current) == cpuset_being_rebound; | 1184 | int ret; |
| 1185 | |||
| 1186 | rcu_read_lock(); | ||
| 1187 | ret = task_cs(current) == cpuset_being_rebound; | ||
| 1188 | rcu_read_unlock(); | ||
| 1189 | |||
| 1190 | return ret; | ||
| 1185 | } | 1191 | } |
| 1186 | 1192 | ||
| 1187 | static int update_relax_domain_level(struct cpuset *cs, s64 val) | 1193 | static int update_relax_domain_level(struct cpuset *cs, s64 val) |
| @@ -1617,7 +1623,17 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of, | |||
| 1617 | * resources, wait for the previously scheduled operations before | 1623 | * resources, wait for the previously scheduled operations before |
| 1618 | * proceeding, so that we don't end up keep removing tasks added | 1624 | * proceeding, so that we don't end up keep removing tasks added |
| 1619 | * after execution capability is restored. | 1625 | * after execution capability is restored. |
| 1626 | * | ||
| 1627 | * cpuset_hotplug_work calls back into cgroup core via | ||
| 1628 | * cgroup_transfer_tasks() and waiting for it from a cgroupfs | ||
| 1629 | * operation like this one can lead to a deadlock through kernfs | ||
| 1630 | * active_ref protection. Let's break the protection. Losing the | ||
| 1631 | * protection is okay as we check whether @cs is online after | ||
| 1632 | * grabbing cpuset_mutex anyway. This only happens on the legacy | ||
| 1633 | * hierarchies. | ||
| 1620 | */ | 1634 | */ |
| 1635 | css_get(&cs->css); | ||
| 1636 | kernfs_break_active_protection(of->kn); | ||
| 1621 | flush_work(&cpuset_hotplug_work); | 1637 | flush_work(&cpuset_hotplug_work); |
| 1622 | 1638 | ||
| 1623 | mutex_lock(&cpuset_mutex); | 1639 | mutex_lock(&cpuset_mutex); |
| @@ -1645,6 +1661,8 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of, | |||
| 1645 | free_trial_cpuset(trialcs); | 1661 | free_trial_cpuset(trialcs); |
| 1646 | out_unlock: | 1662 | out_unlock: |
| 1647 | mutex_unlock(&cpuset_mutex); | 1663 | mutex_unlock(&cpuset_mutex); |
| 1664 | kernfs_unbreak_active_protection(of->kn); | ||
| 1665 | css_put(&cs->css); | ||
| 1648 | return retval ?: nbytes; | 1666 | return retval ?: nbytes; |
| 1649 | } | 1667 | } |
| 1650 | 1668 | ||
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 6203d2900877..35974ac69600 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
| @@ -3284,6 +3284,7 @@ int workqueue_sysfs_register(struct workqueue_struct *wq) | |||
| 3284 | } | 3284 | } |
| 3285 | } | 3285 | } |
| 3286 | 3286 | ||
| 3287 | dev_set_uevent_suppress(&wq_dev->dev, false); | ||
| 3287 | kobject_uevent(&wq_dev->dev.kobj, KOBJ_ADD); | 3288 | kobject_uevent(&wq_dev->dev.kobj, KOBJ_ADD); |
| 3288 | return 0; | 3289 | return 0; |
| 3289 | } | 3290 | } |
| @@ -4879,7 +4880,7 @@ static void __init wq_numa_init(void) | |||
| 4879 | BUG_ON(!tbl); | 4880 | BUG_ON(!tbl); |
| 4880 | 4881 | ||
| 4881 | for_each_node(node) | 4882 | for_each_node(node) |
| 4882 | BUG_ON(!alloc_cpumask_var_node(&tbl[node], GFP_KERNEL, | 4883 | BUG_ON(!zalloc_cpumask_var_node(&tbl[node], GFP_KERNEL, |
| 4883 | node_online(node) ? node : NUMA_NO_NODE)); | 4884 | node_online(node) ? node : NUMA_NO_NODE)); |
| 4884 | 4885 | ||
| 4885 | for_each_possible_cpu(cpu) { | 4886 | for_each_possible_cpu(cpu) { |
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index eb58de19f815..8f5330d74f47 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
| @@ -2139,7 +2139,6 @@ struct mempolicy *__mpol_dup(struct mempolicy *old) | |||
| 2139 | } else | 2139 | } else |
| 2140 | *new = *old; | 2140 | *new = *old; |
| 2141 | 2141 | ||
| 2142 | rcu_read_lock(); | ||
| 2143 | if (current_cpuset_is_being_rebound()) { | 2142 | if (current_cpuset_is_being_rebound()) { |
| 2144 | nodemask_t mems = cpuset_mems_allowed(current); | 2143 | nodemask_t mems = cpuset_mems_allowed(current); |
| 2145 | if (new->flags & MPOL_F_REBINDING) | 2144 | if (new->flags & MPOL_F_REBINDING) |
| @@ -2147,7 +2146,6 @@ struct mempolicy *__mpol_dup(struct mempolicy *old) | |||
| 2147 | else | 2146 | else |
| 2148 | mpol_rebind_policy(new, &mems, MPOL_REBIND_ONCE); | 2147 | mpol_rebind_policy(new, &mems, MPOL_REBIND_ONCE); |
| 2149 | } | 2148 | } |
| 2150 | rcu_read_unlock(); | ||
| 2151 | atomic_set(&new->refcnt, 1); | 2149 | atomic_set(&new->refcnt, 1); |
| 2152 | return new; | 2150 | return new; |
| 2153 | } | 2151 | } |
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index da058da413e7..16a07cfa4d34 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
| @@ -2073,6 +2073,7 @@ sub check_return_section { | |||
| 2073 | sub dump_function($$) { | 2073 | sub dump_function($$) { |
| 2074 | my $prototype = shift; | 2074 | my $prototype = shift; |
| 2075 | my $file = shift; | 2075 | my $file = shift; |
| 2076 | my $noret = 0; | ||
| 2076 | 2077 | ||
| 2077 | $prototype =~ s/^static +//; | 2078 | $prototype =~ s/^static +//; |
| 2078 | $prototype =~ s/^extern +//; | 2079 | $prototype =~ s/^extern +//; |
| @@ -2086,7 +2087,7 @@ sub dump_function($$) { | |||
| 2086 | $prototype =~ s/__init_or_module +//; | 2087 | $prototype =~ s/__init_or_module +//; |
| 2087 | $prototype =~ s/__must_check +//; | 2088 | $prototype =~ s/__must_check +//; |
| 2088 | $prototype =~ s/__weak +//; | 2089 | $prototype =~ s/__weak +//; |
| 2089 | $prototype =~ s/^#\s*define\s+//; #ak added | 2090 | my $define = $prototype =~ s/^#\s*define\s+//; #ak added |
| 2090 | $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; | 2091 | $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; |
| 2091 | 2092 | ||
| 2092 | # Yes, this truly is vile. We are looking for: | 2093 | # Yes, this truly is vile. We are looking for: |
| @@ -2105,7 +2106,15 @@ sub dump_function($$) { | |||
| 2105 | # - atomic_set (macro) | 2106 | # - atomic_set (macro) |
| 2106 | # - pci_match_device, __copy_to_user (long return type) | 2107 | # - pci_match_device, __copy_to_user (long return type) |
| 2107 | 2108 | ||
| 2108 | if ($prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || | 2109 | if ($define && $prototype =~ m/^()([a-zA-Z0-9_~:]+)\s+/) { |
| 2110 | # This is an object-like macro, it has no return type and no parameter | ||
| 2111 | # list. | ||
| 2112 | # Function-like macros are not allowed to have spaces between | ||
| 2113 | # declaration_name and opening parenthesis (notice the \s+). | ||
| 2114 | $return_type = $1; | ||
| 2115 | $declaration_name = $2; | ||
| 2116 | $noret = 1; | ||
| 2117 | } elsif ($prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || | ||
| 2109 | $prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || | 2118 | $prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || |
| 2110 | $prototype =~ m/^(\w+\s*\*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || | 2119 | $prototype =~ m/^(\w+\s*\*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || |
| 2111 | $prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || | 2120 | $prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || |
| @@ -2140,7 +2149,7 @@ sub dump_function($$) { | |||
| 2140 | # of warnings goes sufficiently down, the check is only performed in | 2149 | # of warnings goes sufficiently down, the check is only performed in |
| 2141 | # verbose mode. | 2150 | # verbose mode. |
| 2142 | # TODO: always perform the check. | 2151 | # TODO: always perform the check. |
| 2143 | if ($verbose) { | 2152 | if ($verbose && !$noret) { |
| 2144 | check_return_section($file, $declaration_name, $return_type); | 2153 | check_return_section($file, $declaration_name, $return_type); |
| 2145 | } | 2154 | } |
| 2146 | 2155 | ||
diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c index 0849b7b83f0a..0db94f492e97 100644 --- a/sound/soc/fsl/imx-pcm-dma.c +++ b/sound/soc/fsl/imx-pcm-dma.c | |||
| @@ -59,7 +59,6 @@ int imx_pcm_dma_init(struct platform_device *pdev) | |||
| 59 | { | 59 | { |
| 60 | return devm_snd_dmaengine_pcm_register(&pdev->dev, | 60 | return devm_snd_dmaengine_pcm_register(&pdev->dev, |
| 61 | &imx_dmaengine_pcm_config, | 61 | &imx_dmaengine_pcm_config, |
| 62 | SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | | ||
| 63 | SND_DMAENGINE_PCM_FLAG_COMPAT); | 62 | SND_DMAENGINE_PCM_FLAG_COMPAT); |
| 64 | } | 63 | } |
| 65 | EXPORT_SYMBOL_GPL(imx_pcm_dma_init); | 64 | EXPORT_SYMBOL_GPL(imx_pcm_dma_init); |
diff --git a/tools/thermal/tmon/Makefile b/tools/thermal/tmon/Makefile index 447321104ec0..e775adcbd29f 100644 --- a/tools/thermal/tmon/Makefile +++ b/tools/thermal/tmon/Makefile | |||
| @@ -21,7 +21,7 @@ OBJS = tmon.o tui.o sysfs.o pid.o | |||
| 21 | OBJS += | 21 | OBJS += |
| 22 | 22 | ||
| 23 | tmon: $(OBJS) Makefile tmon.h | 23 | tmon: $(OBJS) Makefile tmon.h |
| 24 | $(CC) ${CFLAGS} $(LDFLAGS) $(OBJS) -o $(TARGET) -lm -lpanel -lncursesw -lpthread | 24 | $(CC) ${CFLAGS} $(LDFLAGS) $(OBJS) -o $(TARGET) -lm -lpanel -lncursesw -ltinfo -lpthread |
| 25 | 25 | ||
| 26 | valgrind: tmon | 26 | valgrind: tmon |
| 27 | sudo valgrind -v --track-origins=yes --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes ./$(TARGET) 1> /dev/null | 27 | sudo valgrind -v --track-origins=yes --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes ./$(TARGET) 1> /dev/null |
diff --git a/tools/thermal/tmon/tmon.c b/tools/thermal/tmon/tmon.c index b30f531173e4..09b7c3218334 100644 --- a/tools/thermal/tmon/tmon.c +++ b/tools/thermal/tmon/tmon.c | |||
| @@ -142,6 +142,7 @@ static void start_syslog(void) | |||
| 142 | static void prepare_logging(void) | 142 | static void prepare_logging(void) |
| 143 | { | 143 | { |
| 144 | int i; | 144 | int i; |
| 145 | struct stat logstat; | ||
| 145 | 146 | ||
| 146 | if (!logging) | 147 | if (!logging) |
| 147 | return; | 148 | return; |
| @@ -152,6 +153,29 @@ static void prepare_logging(void) | |||
| 152 | return; | 153 | return; |
| 153 | } | 154 | } |
| 154 | 155 | ||
| 156 | if (lstat(TMON_LOG_FILE, &logstat) < 0) { | ||
| 157 | syslog(LOG_ERR, "Unable to stat log file %s\n", TMON_LOG_FILE); | ||
| 158 | fclose(tmon_log); | ||
| 159 | tmon_log = NULL; | ||
| 160 | return; | ||
| 161 | } | ||
| 162 | |||
| 163 | /* The log file must be a regular file owned by us */ | ||
| 164 | if (S_ISLNK(logstat.st_mode)) { | ||
| 165 | syslog(LOG_ERR, "Log file is a symlink. Will not log\n"); | ||
| 166 | fclose(tmon_log); | ||
| 167 | tmon_log = NULL; | ||
| 168 | return; | ||
| 169 | } | ||
| 170 | |||
| 171 | if (logstat.st_uid != getuid()) { | ||
| 172 | syslog(LOG_ERR, "We don't own the log file. Not logging\n"); | ||
| 173 | fclose(tmon_log); | ||
| 174 | tmon_log = NULL; | ||
| 175 | return; | ||
| 176 | } | ||
| 177 | |||
| 178 | |||
| 155 | fprintf(tmon_log, "#----------- THERMAL SYSTEM CONFIG -------------\n"); | 179 | fprintf(tmon_log, "#----------- THERMAL SYSTEM CONFIG -------------\n"); |
| 156 | for (i = 0; i < ptdata.nr_tz_sensor; i++) { | 180 | for (i = 0; i < ptdata.nr_tz_sensor; i++) { |
| 157 | char binding_str[33]; /* size of long + 1 */ | 181 | char binding_str[33]; /* size of long + 1 */ |
| @@ -331,7 +355,7 @@ static void start_daemon_mode() | |||
| 331 | disable_tui(); | 355 | disable_tui(); |
| 332 | 356 | ||
| 333 | /* change the file mode mask */ | 357 | /* change the file mode mask */ |
| 334 | umask(0); | 358 | umask(S_IWGRP | S_IWOTH); |
| 335 | 359 | ||
| 336 | /* new SID for the daemon process */ | 360 | /* new SID for the daemon process */ |
| 337 | sid = setsid(); | 361 | sid = setsid(); |
