···280280mcelog281281------282282283283-In Linux 2.6.31+ the i386 kernel needs to run the mcelog utility284284-as a regular cronjob similar to the x86-64 kernel to process and log285285-machine check events when CONFIG_X86_NEW_MCE is enabled. Machine check286286-events are errors reported by the CPU. Processing them is strongly encouraged.287287-All x86-64 kernels since 2.6.4 require the mcelog utility to288288-process machine checks.283283+On x86 kernels the mcelog utility is needed to process and log machine check284284+events when CONFIG_X86_MCE is enabled. Machine check events are errors reported285285+by the CPU. Processing them is strongly encouraged.289286290287Getting updated software291288========================
+1-1
Documentation/DocBook/gadget.tmpl
···708708709709<para>Systems need specialized hardware support to implement OTG,710710notably including a special <emphasis>Mini-AB</emphasis> jack711711-and associated transciever to support <emphasis>Dual-Role</emphasis>711711+and associated transceiver to support <emphasis>Dual-Role</emphasis>712712operation:713713they can act either as a host, using the standard714714Linux-USB host side driver stack,
+2-2
Documentation/DocBook/genericirq.tmpl
···182182 <para>183183 Each interrupt is described by an interrupt descriptor structure184184 irq_desc. The interrupt is referenced by an 'unsigned int' numeric185185- value which selects the corresponding interrupt decription structure185185+ value which selects the corresponding interrupt description structure186186 in the descriptor structures array.187187 The descriptor structure contains status information and pointers188188 to the interrupt flow method and the interrupt chip structure···470470 <para>471471 To avoid copies of identical implementations of IRQ chips the472472 core provides a configurable generic interrupt chip473473- implementation. Developers should check carefuly whether the473473+ implementation. Developers should check carefully whether the474474 generic chip fits their needs before implementing the same475475 functionality slightly differently themselves.476476 </para>
+1-1
Documentation/DocBook/kernel-locking.tmpl
···17601760</para>1761176117621762<para>17631763-There is a furthur optimization possible here: remember our original17631763+There is a further optimization possible here: remember our original17641764cache code, where there were no reference counts and the caller simply17651765held the lock whenever using the object? This is still possible: if17661766you hold the lock, no one can delete the object, so you don't need to
+3-3
Documentation/DocBook/libata.tmpl
···677677678678 <listitem>679679 <para>680680- ATA_QCFLAG_ACTIVE is clared from qc->flags.680680+ ATA_QCFLAG_ACTIVE is cleared from qc->flags.681681 </para>682682 </listitem>683683···708708709709 <listitem>710710 <para>711711- qc->waiting is claread & completed (in that order).711711+ qc->waiting is cleared & completed (in that order).712712 </para>713713 </listitem>714714···1163116311641164 <para>11651165 Once sense data is acquired, this type of errors can be11661166- handled similary to other SCSI errors. Note that sense data11661166+ handled similarly to other SCSI errors. Note that sense data11671167 may indicate ATA bus error (e.g. Sense Key 04h HARDWARE ERROR11681168 && ASC/ASCQ 47h/00h SCSI PARITY ERROR). In such11691169 cases, the error should be considered as an ATA bus error and
+1-1
Documentation/DocBook/media_api.tmpl
···6868 several digital tv standards. While it is called as DVB API,6969 in fact it covers several different video standards including7070 DVB-T, DVB-S, DVB-C and ATSC. The API is currently being updated7171- to documment support also for DVB-S2, ISDB-T and ISDB-S.</para>7171+ to document support also for DVB-S2, ISDB-T and ISDB-S.</para>7272 <para>The third part covers the Remote Controller API.</para>7373 <para>The fourth part covers the Media Controller API.</para>7474 <para>For additional information and for the latest development code,
+15-15
Documentation/DocBook/mtdnand.tmpl
···9191 <listitem><para>9292 [MTD Interface]</para><para>9393 These functions provide the interface to the MTD kernel API. 9494- They are not replacable and provide functionality9494+ They are not replaceable and provide functionality9595 which is complete hardware independent.9696 </para></listitem>9797 <listitem><para>···100100 </para></listitem>101101 <listitem><para>102102 [GENERIC]</para><para>103103- Generic functions are not replacable and provide functionality103103+ Generic functions are not replaceable and provide functionality104104 which is complete hardware independent.105105 </para></listitem>106106 <listitem><para>107107 [DEFAULT]</para><para>108108 Default functions provide hardware related functionality which is suitable109109 for most of the implementations. These functions can be replaced by the110110- board driver if neccecary. Those functions are called via pointers in the110110+ board driver if necessary. Those functions are called via pointers in the111111 NAND chip description structure. The board driver can set the functions which112112 should be replaced by board dependent functions before calling nand_scan().113113 If the function pointer is NULL on entry to nand_scan() then the pointer···264264 is set up nand_scan() is called. This function tries to265265 detect and identify then chip. If a chip is found all the266266 internal data fields are initialized accordingly.267267- The structure(s) have to be zeroed out first and then filled with the neccecary 267267+ The structure(s) have to be zeroed out first and then filled with the necessary268268 information about the device.269269 </para>270270 <programlisting>···327327 <sect1 id="Exit_function">328328 <title>Exit function</title>329329 <para>330330- The exit function is only neccecary if the driver is330330+ The exit function is only necessary if the driver is331331 compiled as a module. It releases all resources which332332 are held by the chip driver and unregisters the partitions333333 in the MTD layer.···494494 in this case. See rts_from4.c and diskonchip.c for 495495 implementation reference. In those cases we must also496496 use bad block tables on FLASH, because the ECC layout is497497- interferring with the bad block marker positions.497497+ interfering with the bad block marker positions.498498 See bad block table support for details.499499 </para>500500 </sect2>···542542 <para> 543543 nand_scan() calls the function nand_default_bbt(). 544544 nand_default_bbt() selects appropriate default545545- bad block table desriptors depending on the chip information545545+ bad block table descriptors depending on the chip information546546 which was retrieved by nand_scan().547547 </para>548548 <para>···554554 <sect2 id="Flash_based_tables">555555 <title>Flash based tables</title>556556 <para>557557- It may be desired or neccecary to keep a bad block table in FLASH. 557557+ It may be desired or necessary to keep a bad block table in FLASH.558558 For AG-AND chips this is mandatory, as they have no factory marked559559 bad blocks. They have factory marked good blocks. The marker pattern560560 is erased when the block is erased to be reused. So in case of···565565 of the blocks.566566 </para>567567 <para>568568- The blocks in which the tables are stored are procteted against568568+ The blocks in which the tables are stored are protected against569569 accidental access by marking them bad in the memory bad block570570 table. The bad block table management functions are allowed571571- to circumvernt this protection.571571+ to circumvent this protection.572572 </para>573573 <para>574574 The simplest way to activate the FLASH based bad block table support ···592592 User defined tables are created by filling out a 593593 nand_bbt_descr structure and storing the pointer in the594594 nand_chip structure member bbt_td before calling nand_scan(). 595595- If a mirror table is neccecary a second structure must be595595+ If a mirror table is necessary a second structure must be596596 created and a pointer to this structure must be stored597597 in bbt_md inside the nand_chip structure. If the bbt_md 598598 member is set to NULL then only the main table is used···666666 <para>667667 For automatic placement some blocks must be reserved for668668 bad block table storage. The number of reserved blocks is defined 669669- in the maxblocks member of the babd block table description structure.669669+ in the maxblocks member of the bad block table description structure.670670 Reserving 4 blocks for mirrored tables should be a reasonable number. 671671 This also limits the number of blocks which are scanned for the bad672672 block table ident pattern.···10681068 <chapter id="filesystems">10691069 <title>Filesystem support</title>10701070 <para>10711071- The NAND driver provides all neccecary functions for a10711071+ The NAND driver provides all necessary functions for a10721072 filesystem via the MTD interface.10731073 </para>10741074 <para>10751075- Filesystems must be aware of the NAND pecularities and10751075+ Filesystems must be aware of the NAND peculiarities and10761076 restrictions. One major restrictions of NAND Flash is, that you cannot 10771077 write as often as you want to a page. The consecutive writes to a page, 10781078 before erasing it again, are restricted to 1-3 writes, depending on the ···12221222#define NAND_BBT_VERSION 0x0000010012231223/* Create a bbt if none axists */12241224#define NAND_BBT_CREATE 0x0000020012251225-/* Write bbt if neccecary */12251225+/* Write bbt if necessary */12261226#define NAND_BBT_WRITE 0x0000100012271227/* Read and write back block contents when writing bbt */12281228#define NAND_BBT_SAVECONTENT 0x00002000
+1-1
Documentation/DocBook/regulator.tmpl
···155155 release regulators. Functions are156156 provided to <link linkend='API-regulator-enable'>enable</link>157157 and <link linkend='API-regulator-disable'>disable</link> the158158- reguator and to get and set the runtime parameters of the158158+ regulator and to get and set the runtime parameters of the159159 regulator.160160 </para>161161 <para>
+2-2
Documentation/DocBook/uio-howto.tmpl
···766766 <para>767767 The dynamic memory regions will be allocated when the UIO device file,768768 <varname>/dev/uioX</varname> is opened.769769- Simiar to static memory resources, the memory region information for769769+ Similar to static memory resources, the memory region information for770770 dynamic regions is then visible via sysfs at771771 <varname>/sys/class/uio/uioX/maps/mapY/*</varname>.772772- The dynmaic memory regions will be freed when the UIO device file is772772+ The dynamic memory regions will be freed when the UIO device file is773773 closed. When no processes are holding the device file open, the address774774 returned to userspace is ~0.775775 </para>
+1-1
Documentation/DocBook/usb.tmpl
···153153154154 <listitem><para>The Linux USB API supports synchronous calls for155155 control and bulk messages.156156- It also supports asynchnous calls for all kinds of data transfer,156156+ It also supports asynchronous calls for all kinds of data transfer,157157 using request structures called "URBs" (USB Request Blocks).158158 </para></listitem>159159
+1-1
Documentation/DocBook/writing-an-alsa-driver.tmpl
···56965696 suspending the PCM operations via56975697 <function>snd_pcm_suspend_all()</function> or56985698 <function>snd_pcm_suspend()</function>. It means that the PCM56995699- streams are already stoppped when the register snapshot is56995699+ streams are already stopped when the register snapshot is57005700 taken. But, remember that you don't have to restart the PCM57015701 stream in the resume callback. It'll be restarted via 57025702 trigger call with <constant>SNDRV_PCM_TRIGGER_RESUME</constant>
+5-2
Documentation/cpu-freq/intel-pstate.txt
···1515/sys/devices/system/cpu/intel_pstate/16161717 max_perf_pct: limits the maximum P state that will be requested by1818- the driver stated as a percentage of the available performance.1818+ the driver stated as a percentage of the available performance. The1919+ available (P states) performance may be reduced by the no_turbo2020+ setting described below.19212022 min_perf_pct: limits the minimum P state that will be requested by2121- the driver stated as a percentage of the available performance.2323+ the driver stated as a percentage of the max (non-turbo)2424+ performance level.22252326 no_turbo: limits the driver to selecting P states below the turbo2427 frequency range.
···99- reg: physical base address of the controller and length of memory mapped1010 region.11111212+Optional Properties:1313+- clocks: List of clock handles. The parent clocks of the input clocks to the1414+ devices in this power domain are set to oscclk before power gating1515+ and restored back after powering on a domain. This is required for1616+ all domains which are powered on and off and not required for unused1717+ domains.1818+- clock-names: The following clocks can be specified:1919+ - oscclk: Oscillator clock.2020+ - pclkN, clkN: Pairs of parent of input clock and input clock to the2121+ devices in this power domain. Maximum of 4 pairs (N = 0 to 3)2222+ are supported currently.2323+1224Node of a device using power domains must have a samsung,power-domain property1325defined with a phandle to respective power domain.1426···2917 lcd0: power-domain-lcd0 {3018 compatible = "samsung,exynos4210-pd";3119 reg = <0x10023C00 0x10>;2020+ };2121+2222+ mfc_pd: power-domain@10044060 {2323+ compatible = "samsung,exynos4210-pd";2424+ reg = <0x10044060 0x20>;2525+ clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_SW_ACLK333>,2626+ <&clock CLK_MOUT_USER_ACLK333>;2727+ clock-names = "oscclk", "pclk0", "clk0";3228 };33293430Example of the node using power domain:
···4455 - compatible: Must contain one of the following:6677+ - "renesas,scifa-sh73a0" for SH73A0 (SH-Mobile AG5) SCIFA compatible UART.88+ - "renesas,scifb-sh73a0" for SH73A0 (SH-Mobile AG5) SCIFB compatible UART.99+ - "renesas,scifa-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFA compatible UART.1010+ - "renesas,scifb-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFB compatible UART.1111+ - "renesas,scifa-r8a7740" for R8A7740 (R-Mobile A1) SCIFA compatible UART.1212+ - "renesas,scifb-r8a7740" for R8A7740 (R-Mobile A1) SCIFB compatible UART.1313+ - "renesas,scif-r8a7778" for R8A7778 (R-Car M1) SCIF compatible UART.714 - "renesas,scif-r8a7779" for R8A7779 (R-Car H1) SCIF compatible UART.815 - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.916 - "renesas,scifa-r8a7790" for R8A7790 (R-Car H2) SCIFA compatible UART.
+2-2
Documentation/laptops/00-INDEX
···88 - information on hard disk shock protection.99dslm.c1010 - Simple Disk Sleep Monitor program1111-hpfall.c1212- - (HP) laptop accelerometer program for disk protection.1111+freefall.c1212+ - (HP/DELL) laptop accelerometer program for disk protection.1313laptop-mode.txt1414 - how to conserve battery power using laptop-mode.1515sony-laptop.txt
···11VERSION = 322PATCHLEVEL = 1633SUBLEVEL = 044-EXTRAVERSION = -rc444+EXTRAVERSION = -rc555NAME = Shuffling Zombie Juror6677# *DOCUMENTATION*···4141# descending is started. They are now explicitly listed as the4242# prepare rule.43434444+# Beautify output4545+# ---------------------------------------------------------------------------4646+#4747+# Normally, we echo the whole command before executing it. By making4848+# that echo $($(quiet)$(cmd)), we now have the possibility to set4949+# $(quiet) to choose other forms of output instead, e.g.5050+#5151+# quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@5252+# cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<5353+#5454+# If $(quiet) is empty, the whole command will be printed.5555+# If it is set to "quiet_", only the short version will be printed.5656+# If it is set to "silent_", nothing will be printed at all, since5757+# the variable $(silent_cmd_cc_o_c) doesn't exist.5858+#5959+# A simple variant is to prefix commands with $(Q) - that's useful6060+# for commands that shall be hidden in non-verbose mode.6161+#6262+# $(Q)ln $@ :<6363+#6464+# If KBUILD_VERBOSE equals 0 then the above command will be hidden.6565+# If KBUILD_VERBOSE equals 1 then the above command is displayed.6666+#4467# To put more focus on warnings, be less verbose as default4568# Use 'make V=1' to see the full commands4669···7350ifndef KBUILD_VERBOSE7451 KBUILD_VERBOSE = 07552endif5353+5454+ifeq ($(KBUILD_VERBOSE),1)5555+ quiet =5656+ Q =5757+else5858+ quiet=quiet_5959+ Q = @6060+endif6161+6262+# If the user is running make -s (silent mode), suppress echoing of6363+# commands6464+6565+ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-46666+ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)6767+ quiet=silent_6868+endif6969+else # make-3.8x7070+ifneq ($(filter s% -s%,$(MAKEFLAGS)),)7171+ quiet=silent_7272+endif7373+endif7474+7575+export quiet Q KBUILD_VERBOSE76767777# Call a source code checker (by default, "sparse") as part of the7878# C compilation.···174128175129# Fake the "Entering directory" message once, so that IDEs/editors are176130# able to understand relative filenames.131131+ echodir := @echo132132+ quiet_echodir := @echo133133+silent_echodir := @:177134sub-make: FORCE178178- @echo "make[1]: Entering directory \`$(KBUILD_OUTPUT)'"135135+ $($(quiet)echodir) "make[1]: Entering directory \`$(KBUILD_OUTPUT)'"179136 $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \180137 KBUILD_SRC=$(CURDIR) \181138 KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \···340291341292export KBUILD_MODULES KBUILD_BUILTIN342293export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD343343-344344-# Beautify output345345-# ---------------------------------------------------------------------------346346-#347347-# Normally, we echo the whole command before executing it. By making348348-# that echo $($(quiet)$(cmd)), we now have the possibility to set349349-# $(quiet) to choose other forms of output instead, e.g.350350-#351351-# quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@352352-# cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<353353-#354354-# If $(quiet) is empty, the whole command will be printed.355355-# If it is set to "quiet_", only the short version will be printed.356356-# If it is set to "silent_", nothing will be printed at all, since357357-# the variable $(silent_cmd_cc_o_c) doesn't exist.358358-#359359-# A simple variant is to prefix commands with $(Q) - that's useful360360-# for commands that shall be hidden in non-verbose mode.361361-#362362-# $(Q)ln $@ :<363363-#364364-# If KBUILD_VERBOSE equals 0 then the above command will be hidden.365365-# If KBUILD_VERBOSE equals 1 then the above command is displayed.366366-367367-ifeq ($(KBUILD_VERBOSE),1)368368- quiet =369369- Q =370370-else371371- quiet=quiet_372372- Q = @373373-endif374374-375375-# If the user is running make -s (silent mode), suppress echoing of376376-# commands377377-378378-ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4379379-ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)380380- quiet=silent_381381-endif382382-else # make-3.8x383383-ifneq ($(filter s% -s%,$(MAKEFLAGS)),)384384- quiet=silent_385385-endif386386-endif387387-388388-export quiet Q KBUILD_VERBOSE389294390295ifneq ($(CC),)391296ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)···11761173# Packaging of the kernel to various formats11771174# ---------------------------------------------------------------------------11781175# rpm target kept for backward compatibility11791179-package-dir := $(srctree)/scripts/package11761176+package-dir := scripts/package1180117711811178%src-pkg: FORCE11821179 $(Q)$(MAKE) $(build)=$(package-dir) $@
···7474 TEST_RRR( op "lt" s " r11, r",11,VAL1,", r",14,N(val),", asr r",7, 6,"")\7575 TEST_RR( op "gt" s " r12, r13" ", r",14,val, ", ror r",14,7,"")\7676 TEST_RR( op "le" s " r14, r",0, val, ", r13" ", lsl r",14,8,"")\7777- TEST_RR( op s " r12, pc" ", r",14,val, ", ror r",14,7,"")\7878- TEST_RR( op s " r14, r",0, val, ", pc" ", lsl r",14,8,"")\7977 TEST_R( op "eq" s " r0, r",11,VAL1,", #0xf5") \8078 TEST_R( op "ne" s " r11, r",0, VAL1,", #0xf5000000") \8179 TEST_R( op s " r7, r",8, VAL2,", #0x000af000") \···101103 TEST_RRR( op "ge r",11,VAL1,", r",14,N(val),", asr r",7, 6,"") \102104 TEST_RR( op "le r13" ", r",14,val, ", ror r",14,7,"") \103105 TEST_RR( op "gt r",0, val, ", r13" ", lsl r",14,8,"") \104104- TEST_RR( op " pc" ", r",14,val, ", ror r",14,7,"") \105105- TEST_RR( op " r",0, val, ", pc" ", lsl r",14,8,"") \106106 TEST_R( op "eq r",11,VAL1,", #0xf5") \107107 TEST_R( op "ne r",0, VAL1,", #0xf5000000") \108108 TEST_R( op " r",8, VAL2,", #0x000af000")···121125 TEST_RR( op "ge" s " r11, r",11,N(val),", asr r",7, 6,"") \122126 TEST_RR( op "lt" s " r12, r",11,val, ", ror r",14,7,"") \123127 TEST_R( op "gt" s " r14, r13" ", lsl r",14,8,"") \124124- TEST_R( op "le" s " r14, pc" ", lsl r",14,8,"") \125128 TEST( op "eq" s " r0, #0xf5") \126129 TEST( op "ne" s " r11, #0xf5000000") \127130 TEST( op s " r7, #0x000af000") \···154159 TEST_SUPPORTED("cmp pc, #0x1000");155160 TEST_SUPPORTED("cmp sp, #0x1000");156161157157- /* Data-processing with PC as shift*/162162+ /* Data-processing with PC and a shift count in a register */158163 TEST_UNSUPPORTED(__inst_arm(0xe15c0f1e) " @ cmp r12, r14, asl pc")159164 TEST_UNSUPPORTED(__inst_arm(0xe1a0cf1e) " @ mov r12, r14, asl pc")160165 TEST_UNSUPPORTED(__inst_arm(0xe08caf1e) " @ add r10, r12, r14, asl pc")166166+ TEST_UNSUPPORTED(__inst_arm(0xe151021f) " @ cmp r1, pc, lsl r2")167167+ TEST_UNSUPPORTED(__inst_arm(0xe17f0211) " @ cmn pc, r1, lsl r2")168168+ TEST_UNSUPPORTED(__inst_arm(0xe1a0121f) " @ mov r1, pc, lsl r2")169169+ TEST_UNSUPPORTED(__inst_arm(0xe1a0f211) " @ mov pc, r1, lsl r2")170170+ TEST_UNSUPPORTED(__inst_arm(0xe042131f) " @ sub r1, r2, pc, lsl r3")171171+ TEST_UNSUPPORTED(__inst_arm(0xe1cf1312) " @ bic r1, pc, r2, lsl r3")172172+ TEST_UNSUPPORTED(__inst_arm(0xe081f312) " @ add pc, r1, r2, lsl r3")161173162162- /* Data-processing with PC as shift*/174174+ /* Data-processing with PC as a target and status registers updated */163175 TEST_UNSUPPORTED("movs pc, r1")164176 TEST_UNSUPPORTED("movs pc, r1, lsl r2")165177 TEST_UNSUPPORTED("movs pc, #0x10000")···189187 TEST_BF_R ("add pc, pc, r",14,2f-1f-8,"")190188 TEST_BF_R ("add pc, r",14,2f-1f-8,", pc")191189 TEST_BF_R ("mov pc, r",0,2f,"")192192- TEST_BF_RR("mov pc, r",0,2f,", asl r",1,0,"")190190+ TEST_BF_R ("add pc, pc, r",14,(2f-1f-8)*2,", asr #1")193191 TEST_BB( "sub pc, pc, #1b-2b+8")194192#if __LINUX_ARM_ARCH__ == 6 && !defined(CONFIG_CPU_V7)195193 TEST_BB( "sub pc, pc, #1b-2b+8-2") /* UNPREDICTABLE before and after ARMv6 */196194#endif197195 TEST_BB_R( "sub pc, pc, r",14, 1f-2f+8,"")198196 TEST_BB_R( "rsb pc, r",14,1f-2f+8,", pc")199199- TEST_RR( "add pc, pc, r",10,-2,", asl r",11,1,"")197197+ TEST_R( "add pc, pc, r",10,-2,", asl #1")200198#ifdef CONFIG_THUMB2_KERNEL201199 TEST_ARM_TO_THUMB_INTERWORK_R("add pc, pc, r",0,3f-1f-8+1,"")202200 TEST_ARM_TO_THUMB_INTERWORK_R("sub pc, r",0,3f+8+1,", #8")···218216 TEST_BB_R("bx r",7,2f,"")219217 TEST_BF_R("bxeq r",14,2f,"")220218219219+#if __LINUX_ARM_ARCH__ >= 5221220 TEST_R("clz r0, r",0, 0x0,"")222221 TEST_R("clzeq r7, r",14,0x1,"")223222 TEST_R("clz lr, r",7, 0xffffffff,"")···340337 TEST_UNSUPPORTED(__inst_arm(0xe16f02e1) " @ smultt pc, r1, r2")341338 TEST_UNSUPPORTED(__inst_arm(0xe16002ef) " @ smultt r0, pc, r2")342339 TEST_UNSUPPORTED(__inst_arm(0xe1600fe1) " @ smultt r0, r1, pc")340340+#endif343341344342 TEST_GROUP("Multiply and multiply-accumulate")345343···563559 TEST_UNSUPPORTED("ldrsht r1, [r2], #48")564560#endif565561562562+#if __LINUX_ARM_ARCH__ >= 5566563 TEST_RPR( "strd r",0, VAL1,", [r",1, 48,", -r",2,24,"]")567564 TEST_RPR( "strccd r",8, VAL2,", [r",13,0, ", r",12,48,"]")568565 TEST_RPR( "strd r",4, VAL1,", [r",2, 24,", r",3, 48,"]!")···600595 TEST_UNSUPPORTED(__inst_arm(0xe1efc3d0) " @ ldrd r12, [pc, #48]!")601596 TEST_UNSUPPORTED(__inst_arm(0xe0c9f3d0) " @ ldrd pc, [r9], #48")602597 TEST_UNSUPPORTED(__inst_arm(0xe0c9e3d0) " @ ldrd lr, [r9], #48")598598+#endif603599604600 TEST_GROUP("Miscellaneous")605601···12331227 TEST_COPROCESSOR( "mrc"two" 0, 0, r0, cr0, cr0, 0")1234122812351229 COPROCESSOR_INSTRUCTIONS_ST_LD("",e)12301230+#if __LINUX_ARM_ARCH__ >= 512361231 COPROCESSOR_INSTRUCTIONS_MC_MR("",e)12321232+#endif12371233 TEST_UNSUPPORTED("svc 0")12381234 TEST_UNSUPPORTED("svc 0xffffff")12391235···12951287 TEST( "blx __dummy_thumb_subroutine_odd")12961288#endif /* __LINUX_ARM_ARCH__ >= 6 */1297128912901290+#if __LINUX_ARM_ARCH__ >= 512981291 COPROCESSOR_INSTRUCTIONS_ST_LD("2",f)12921292+#endif12991293#if __LINUX_ARM_ARCH__ >= 613001294 COPROCESSOR_INSTRUCTIONS_MC_MR("2",f)13011295#endif
+10
arch/arm/kernel/kprobes-test.c
···225225static int post_handler_called;226226static int jprobe_func_called;227227static int kretprobe_handler_called;228228+static int tests_failed;228229229230#define FUNC_ARG1 0x12345678230231#define FUNC_ARG2 0xabcdef···462461463462 pr_info(" jprobe\n");464463 ret = test_jprobe(func);464464+#if defined(CONFIG_THUMB2_KERNEL) && !defined(MODULE)465465+ if (ret == -EINVAL) {466466+ pr_err("FAIL: Known longtime bug with jprobe on Thumb kernels\n");467467+ tests_failed = ret;468468+ ret = 0;469469+ }470470+#endif465471 if (ret < 0)466472 return ret;467473···16791671#endif1680167216811673out:16741674+ if (ret == 0)16751675+ ret = tests_failed;16821676 if (ret == 0)16831677 pr_info("Finished kprobe tests OK\n");16841678 else
···173173174174void __init exynos_cpuidle_init(void)175175{176176- if (soc_is_exynos5440())177177- return;178178-179179- platform_device_register(&exynos_cpuidle);176176+ if (soc_is_exynos4210() || soc_is_exynos5250())177177+ platform_device_register(&exynos_cpuidle);180178}181179182180void __init exynos_cpufreq_init(void)···295297 * This is called from smp_prepare_cpus if we've built for SMP, but296298 * we still need to set it up for PM and firmware ops if not.297299 */298298- if (!IS_ENABLED(SMP))300300+ if (!IS_ENABLED(CONFIG_SMP))299301 exynos_sysram_init();300302301303 exynos_cpuidle_init();
+7-2
arch/arm/mach-exynos/firmware.c
···57575858 boot_reg = sysram_ns_base_addr + 0x1c;59596060- if (!soc_is_exynos4212() && !soc_is_exynos3250())6161- boot_reg += 4*cpu;6060+ /*6161+ * Almost all Exynos-series of SoCs that run in secure mode don't need6262+ * additional offset for every CPU, with Exynos4412 being the only6363+ * exception.6464+ */6565+ if (soc_is_exynos4412())6666+ boot_reg += 4 * cpu;62676368 __raw_writel(boot_addr, boot_reg);6469 return 0;
+60-1
arch/arm/mach-exynos/pm_domains.c
···1717#include <linux/err.h>1818#include <linux/slab.h>1919#include <linux/pm_domain.h>2020+#include <linux/clk.h>2021#include <linux/delay.h>2122#include <linux/of_address.h>2223#include <linux/of_platform.h>2324#include <linux/sched.h>24252526#include "regs-pmu.h"2727+2828+#define MAX_CLK_PER_DOMAIN 426292730/*2831 * Exynos specific wrapper around the generic power domain···3532 char const *name;3633 bool is_off;3734 struct generic_pm_domain pd;3535+ struct clk *oscclk;3636+ struct clk *clk[MAX_CLK_PER_DOMAIN];3737+ struct clk *pclk[MAX_CLK_PER_DOMAIN];3838};39394040static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)···49435044 pd = container_of(domain, struct exynos_pm_domain, pd);5145 base = pd->base;4646+4747+ /* Set oscclk before powering off a domain*/4848+ if (!power_on) {4949+ int i;5050+5151+ for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {5252+ if (IS_ERR(pd->clk[i]))5353+ break;5454+ if (clk_set_parent(pd->clk[i], pd->oscclk))5555+ pr_err("%s: error setting oscclk as parent to clock %d\n",5656+ pd->name, i);5757+ }5858+ }52595360 pwr = power_on ? S5P_INT_LOCAL_PWR_EN : 0;5461 __raw_writel(pwr, base);···7960 cpu_relax();8061 usleep_range(80, 100);8162 }6363+6464+ /* Restore clocks after powering on a domain*/6565+ if (power_on) {6666+ int i;6767+6868+ for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {6969+ if (IS_ERR(pd->clk[i]))7070+ break;7171+ if (clk_set_parent(pd->clk[i], pd->pclk[i]))7272+ pr_err("%s: error setting parent to clock%d\n",7373+ pd->name, i);7474+ }7575+ }7676+8277 return 0;8378}8479···185152186153 for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {187154 struct exynos_pm_domain *pd;188188- int on;155155+ int on, i;156156+ struct device *dev;189157190158 pdev = of_find_device_by_node(np);159159+ dev = &pdev->dev;191160192161 pd = kzalloc(sizeof(*pd), GFP_KERNEL);193162 if (!pd) {···205170 pd->pd.power_on = exynos_pd_power_on;206171 pd->pd.of_node = np;207172173173+ pd->oscclk = clk_get(dev, "oscclk");174174+ if (IS_ERR(pd->oscclk))175175+ goto no_clk;176176+177177+ for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {178178+ char clk_name[8];179179+180180+ snprintf(clk_name, sizeof(clk_name), "clk%d", i);181181+ pd->clk[i] = clk_get(dev, clk_name);182182+ if (IS_ERR(pd->clk[i]))183183+ break;184184+ snprintf(clk_name, sizeof(clk_name), "pclk%d", i);185185+ pd->pclk[i] = clk_get(dev, clk_name);186186+ if (IS_ERR(pd->pclk[i])) {187187+ clk_put(pd->clk[i]);188188+ pd->clk[i] = ERR_PTR(-EINVAL);189189+ break;190190+ }191191+ }192192+193193+ if (IS_ERR(pd->clk[0]))194194+ clk_put(pd->oscclk);195195+196196+no_clk:208197 platform_set_drvdata(pdev, pd);209198210199 on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN;
+23-8
arch/arm/mach-imx/clk-gate2.c
···67676868 spin_lock_irqsave(gate->lock, flags);69697070- if (gate->share_count && --(*gate->share_count) > 0)7171- goto out;7070+ if (gate->share_count) {7171+ if (WARN_ON(*gate->share_count == 0))7272+ goto out;7373+ else if (--(*gate->share_count) > 0)7474+ goto out;7575+ }72767377 reg = readl(gate->reg);7478 reg &= ~(3 << gate->bit_idx);···8278 spin_unlock_irqrestore(gate->lock, flags);8379}84808585-static int clk_gate2_is_enabled(struct clk_hw *hw)8181+static int clk_gate2_reg_is_enabled(void __iomem *reg, u8 bit_idx)8682{8787- u32 reg;8888- struct clk_gate2 *gate = to_clk_gate2(hw);8383+ u32 val = readl(reg);89849090- reg = readl(gate->reg);9191-9292- if (((reg >> gate->bit_idx) & 1) == 1)8585+ if (((val >> bit_idx) & 1) == 1)9386 return 1;94879588 return 0;8989+}9090+9191+static int clk_gate2_is_enabled(struct clk_hw *hw)9292+{9393+ struct clk_gate2 *gate = to_clk_gate2(hw);9494+9595+ if (gate->share_count)9696+ return !!(*gate->share_count);9797+ else9898+ return clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx);9699}9710098101static struct clk_ops clk_gate2_ops = {···127116 gate->bit_idx = bit_idx;128117 gate->flags = clk_gate2_flags;129118 gate->lock = lock;119119+120120+ /* Initialize share_count per hardware state */121121+ if (share_count)122122+ *share_count = clk_gate2_reg_is_enabled(reg, bit_idx) ? 1 : 0;130123 gate->share_count = share_count;131124132125 init.name = name;
+1-1
arch/arm/mach-omap2/clkt_dpll.c
···7676 * (assuming that it is counting N upwards), or -2 if the enclosing loop7777 * should skip to the next iteration (again assuming N is increasing).7878 */7979-static int _dpll_test_fint(struct clk_hw_omap *clk, u8 n)7979+static int _dpll_test_fint(struct clk_hw_omap *clk, unsigned int n)8080{8181 struct dpll_data *dd;8282 long fint, fint_min, fint_max;
···414414config CRASH_DUMP415415 bool "Build a kdump crash kernel"416416 depends on PPC64 || 6xx || FSL_BOOKE || (44x && !SMP)417417- select RELOCATABLE if PPC64 || 44x || FSL_BOOKE417417+ select RELOCATABLE if (PPC64 && !COMPILE_TEST) || 44x || FSL_BOOKE418418 help419419 Build a kernel suitable for use as a kdump capture kernel.420420 The same kernel binary can be used as production kernel and dump···10171017if PPC6410181018config RELOCATABLE10191019 bool "Build a relocatable kernel"10201020+ depends on !COMPILE_TEST10201021 select NONSTATIC_KERNEL10211022 help10221023 This builds a kernel image that is capable of running anywhere
···485485 * check that the PMU supports EBB, meaning those that don't can still486486 * use bit 63 of the event code for something else if they wish.487487 */488488- return (ppmu->flags & PPMU_EBB) &&488488+ return (ppmu->flags & PPMU_ARCH_207S) &&489489 ((event->attr.config >> PERF_EVENT_CONFIG_EBB_SHIFT) & 1);490490}491491···777777 if (ppmu->flags & PPMU_HAS_SIER)778778 sier = mfspr(SPRN_SIER);779779780780- if (ppmu->flags & PPMU_EBB) {780780+ if (ppmu->flags & PPMU_ARCH_207S) {781781 pr_info("MMCR2: %016lx EBBHR: %016lx\n",782782 mfspr(SPRN_MMCR2), mfspr(SPRN_EBBHR));783783 pr_info("EBBRR: %016lx BESCR: %016lx\n",···996996 } while (local64_cmpxchg(&event->hw.prev_count, prev, val) != prev);997997998998 local64_add(delta, &event->count);999999- local64_sub(delta, &event->hw.period_left);999999+10001000+ /*10011001+ * A number of places program the PMC with (0x80000000 - period_left).10021002+ * We never want period_left to be less than 1 because we will program10031003+ * the PMC with a value >= 0x800000000 and an edge detected PMC will10041004+ * roll around to 0 before taking an exception. We have seen this10051005+ * on POWER8.10061006+ *10071007+ * To fix this, clamp the minimum value of period_left to 1.10081008+ */10091009+ do {10101010+ prev = local64_read(&event->hw.period_left);10111011+ val = prev - delta;10121012+ if (val < 1)10131013+ val = 1;10141014+ } while (local64_cmpxchg(&event->hw.period_left, prev, val) != prev);10001015}1001101610021017/*···13141299 ppmu->config_bhrb(cpuhw->bhrb_filter);1315130013161301 write_mmcr0(cpuhw, mmcr0);13021302+13031303+ if (ppmu->flags & PPMU_ARCH_207S)13041304+ mtspr(SPRN_MMCR2, 0);1317130513181306 /*13191307 * Enable instruction sampling if necessary···1714169617151697 if (has_branch_stack(event)) {17161698 /* PMU has BHRB enabled */17171717- if (!(ppmu->flags & PPMU_BHRB))16991699+ if (!(ppmu->flags & PPMU_ARCH_207S))17181700 return -EOPNOTSUPP;17191701 }17201702
···6262 Only used for the 64-bit and x32 vdsos. */6363static unsigned long vdso_addr(unsigned long start, unsigned len)6464{6565+#ifdef CONFIG_X86_326666+ return 0;6767+#else6568 unsigned long addr, end;6669 unsigned offset;6770 end = (start + PMD_SIZE - 1) & PMD_MASK;···8683 addr = align_vdso_addr(addr);87848885 return addr;8686+#endif8987}90889189static int map_vdso(const struct vdso_image *image, bool calculate_addr)
+129-3
drivers/acpi/ac.c
···3030#include <linux/types.h>3131#include <linux/dmi.h>3232#include <linux/delay.h>3333+#ifdef CONFIG_ACPI_PROCFS_POWER3434+#include <linux/proc_fs.h>3535+#include <linux/seq_file.h>3636+#endif3337#include <linux/platform_device.h>3438#include <linux/power_supply.h>3539#include <linux/acpi.h>···5652MODULE_DESCRIPTION("ACPI AC Adapter Driver");5753MODULE_LICENSE("GPL");58545555+5956static int acpi_ac_add(struct acpi_device *device);6057static int acpi_ac_remove(struct acpi_device *device);6158static void acpi_ac_notify(struct acpi_device *device, u32 event);···7166static int acpi_ac_resume(struct device *dev);7267#endif7368static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);6969+7070+#ifdef CONFIG_ACPI_PROCFS_POWER7171+extern struct proc_dir_entry *acpi_lock_ac_dir(void);7272+extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);7373+static int acpi_ac_open_fs(struct inode *inode, struct file *file);7474+#endif7575+74767577static int ac_sleep_before_get_state_ms;7678···10290};1039110492#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger)9393+9494+#ifdef CONFIG_ACPI_PROCFS_POWER9595+static const struct file_operations acpi_ac_fops = {9696+ .owner = THIS_MODULE,9797+ .open = acpi_ac_open_fs,9898+ .read = seq_read,9999+ .llseek = seq_lseek,100100+ .release = single_release,101101+};102102+#endif105103106104/* --------------------------------------------------------------------------107105 AC Adapter Management···164142static enum power_supply_property ac_props[] = {165143 POWER_SUPPLY_PROP_ONLINE,166144};145145+146146+#ifdef CONFIG_ACPI_PROCFS_POWER147147+/* --------------------------------------------------------------------------148148+ FS Interface (/proc)149149+ -------------------------------------------------------------------------- */150150+151151+static struct proc_dir_entry *acpi_ac_dir;152152+153153+static int acpi_ac_seq_show(struct seq_file *seq, void *offset)154154+{155155+ struct acpi_ac *ac = seq->private;156156+157157+158158+ if (!ac)159159+ return 0;160160+161161+ if (acpi_ac_get_state(ac)) {162162+ seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");163163+ return 0;164164+ }165165+166166+ seq_puts(seq, "state: ");167167+ switch (ac->state) {168168+ case ACPI_AC_STATUS_OFFLINE:169169+ seq_puts(seq, "off-line\n");170170+ break;171171+ case ACPI_AC_STATUS_ONLINE:172172+ seq_puts(seq, "on-line\n");173173+ break;174174+ default:175175+ seq_puts(seq, "unknown\n");176176+ break;177177+ }178178+179179+ return 0;180180+}181181+182182+static int acpi_ac_open_fs(struct inode *inode, struct file *file)183183+{184184+ return single_open(file, acpi_ac_seq_show, PDE_DATA(inode));185185+}186186+187187+static int acpi_ac_add_fs(struct acpi_ac *ac)188188+{189189+ struct proc_dir_entry *entry = NULL;190190+191191+ printk(KERN_WARNING PREFIX "Deprecated procfs I/F for AC is loaded,"192192+ " please retry with CONFIG_ACPI_PROCFS_POWER cleared\n");193193+ if (!acpi_device_dir(ac->device)) {194194+ acpi_device_dir(ac->device) =195195+ proc_mkdir(acpi_device_bid(ac->device), acpi_ac_dir);196196+ if (!acpi_device_dir(ac->device))197197+ return -ENODEV;198198+ }199199+200200+ /* 'state' [R] */201201+ entry = proc_create_data(ACPI_AC_FILE_STATE,202202+ S_IRUGO, acpi_device_dir(ac->device),203203+ &acpi_ac_fops, ac);204204+ if (!entry)205205+ return -ENODEV;206206+ return 0;207207+}208208+209209+static int acpi_ac_remove_fs(struct acpi_ac *ac)210210+{211211+212212+ if (acpi_device_dir(ac->device)) {213213+ remove_proc_entry(ACPI_AC_FILE_STATE,214214+ acpi_device_dir(ac->device));215215+ remove_proc_entry(acpi_device_bid(ac->device), acpi_ac_dir);216216+ acpi_device_dir(ac->device) = NULL;217217+ }218218+219219+ return 0;220220+}221221+#endif167222168223/* --------------------------------------------------------------------------169224 Driver Model···342243 goto end;343244344245 ac->charger.name = acpi_device_bid(device);246246+#ifdef CONFIG_ACPI_PROCFS_POWER247247+ result = acpi_ac_add_fs(ac);248248+ if (result)249249+ goto end;250250+#endif345251 ac->charger.type = POWER_SUPPLY_TYPE_MAINS;346252 ac->charger.properties = ac_props;347253 ac->charger.num_properties = ARRAY_SIZE(ac_props);···362258 ac->battery_nb.notifier_call = acpi_ac_battery_notify;363259 register_acpi_notifier(&ac->battery_nb);364260end:365365- if (result)261261+ if (result) {262262+#ifdef CONFIG_ACPI_PROCFS_POWER263263+ acpi_ac_remove_fs(ac);264264+#endif366265 kfree(ac);266266+ }367267368268 dmi_check_system(ac_dmi_table);369269 return result;···411303 power_supply_unregister(&ac->charger);412304 unregister_acpi_notifier(&ac->battery_nb);413305306306+#ifdef CONFIG_ACPI_PROCFS_POWER307307+ acpi_ac_remove_fs(ac);308308+#endif309309+414310 kfree(ac);415311416312 return 0;···427315 if (acpi_disabled)428316 return -ENODEV;429317430430- result = acpi_bus_register_driver(&acpi_ac_driver);431431- if (result < 0)318318+#ifdef CONFIG_ACPI_PROCFS_POWER319319+ acpi_ac_dir = acpi_lock_ac_dir();320320+ if (!acpi_ac_dir)432321 return -ENODEV;322322+#endif323323+324324+325325+ result = acpi_bus_register_driver(&acpi_ac_driver);326326+ if (result < 0) {327327+#ifdef CONFIG_ACPI_PROCFS_POWER328328+ acpi_unlock_ac_dir(acpi_ac_dir);329329+#endif330330+ return -ENODEV;331331+ }433332434333 return 0;435334}···448325static void __exit acpi_ac_exit(void)449326{450327 acpi_bus_unregister_driver(&acpi_ac_driver);328328+#ifdef CONFIG_ACPI_PROCFS_POWER329329+ acpi_unlock_ac_dir(acpi_ac_dir);330330+#endif451331}452332module_init(acpi_ac_init);453333module_exit(acpi_ac_exit);
···3535#include <linux/delay.h>3636#include <linux/slab.h>3737#include <linux/suspend.h>3838+#include <linux/delay.h>3839#include <asm/unaligned.h>39404041#ifdef CONFIG_ACPI_PROCFS_POWER···533532 battery->rate_now = abs((s16)battery->rate_now);534533 printk_once(KERN_WARNING FW_BUG "battery: (dis)charge rate"535534 " invalid.\n");535535+ }536536+537537+ /*538538+ * When fully charged, some batteries wrongly report539539+ * capacity_now = design_capacity instead of = full_charge_capacity540540+ */541541+ if (battery->capacity_now > battery->full_charge_capacity542542+ && battery->full_charge_capacity != ACPI_BATTERY_VALUE_UNKNOWN) {543543+ battery->capacity_now = battery->full_charge_capacity;544544+ if (battery->capacity_now != battery->design_capacity)545545+ printk_once(KERN_WARNING FW_BUG546546+ "battery: reported current charge level (%d) "547547+ "is higher than reported maximum charge level (%d).\n",548548+ battery->capacity_now, battery->full_charge_capacity);536549 }537550538551 if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags)···11661151 {},11671152};1168115311541154+/*11551155+ * Some machines'(E,G Lenovo Z480) ECs are not stable11561156+ * during boot up and this causes battery driver fails to be11571157+ * probed due to failure of getting battery information11581158+ * from EC sometimes. After several retries, the operation11591159+ * may work. So add retry code here and 20ms sleep between11601160+ * every retries.11611161+ */11621162+static int acpi_battery_update_retry(struct acpi_battery *battery)11631163+{11641164+ int retry, ret;11651165+11661166+ for (retry = 5; retry; retry--) {11671167+ ret = acpi_battery_update(battery, false);11681168+ if (!ret)11691169+ break;11701170+11711171+ msleep(20);11721172+ }11731173+ return ret;11741174+}11751175+11691176static int acpi_battery_add(struct acpi_device *device)11701177{11711178 int result = 0;···12061169 mutex_init(&battery->sysfs_lock);12071170 if (acpi_has_method(battery->device->handle, "_BIX"))12081171 set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags);12091209- result = acpi_battery_update(battery, false);11721172+11731173+ result = acpi_battery_update_retry(battery);12101174 if (result)12111175 goto fail;11761176+12121177#ifdef CONFIG_ACPI_PROCFS_POWER12131178 result = acpi_battery_add_fs(device);12141179#endif
+85-79
drivers/acpi/ec.c
···11/*22- * ec.c - ACPI Embedded Controller Driver (v2.1)22+ * ec.c - ACPI Embedded Controller Driver (v2.2)33 *44- * Copyright (C) 2006-2008 Alexey Starikovskiy <astarikovskiy@suse.de>55- * Copyright (C) 2006 Denis Sadykov <denis.m.sadykov@intel.com>66- * Copyright (C) 2004 Luming Yu <luming.yu@intel.com>77- * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>88- * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>44+ * Copyright (C) 2001-2014 Intel Corporation55+ * Author: 2014 Lv Zheng <lv.zheng@intel.com>66+ * 2006, 2007 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>77+ * 2006 Denis Sadykov <denis.m.sadykov@intel.com>88+ * 2004 Luming Yu <luming.yu@intel.com>99+ * 2001, 2002 Andy Grover <andrew.grover@intel.com>1010+ * 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>1111+ * Copyright (C) 2008 Alexey Starikovskiy <astarikovskiy@suse.de>912 *1013 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1114 *···5552/* EC status register */5653#define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */5754#define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */5555+#define ACPI_EC_FLAG_CMD 0x08 /* Input buffer contains a command */5856#define ACPI_EC_FLAG_BURST 0x10 /* burst mode */5957#define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */6058···8177 * OpReg are installed */8278 EC_FLAGS_BLOCKED, /* Transactions are blocked */8379};8080+8181+#define ACPI_EC_COMMAND_POLL 0x01 /* Available for command byte */8282+#define ACPI_EC_COMMAND_COMPLETE 0x02 /* Completed last byte */84838584/* ec.c is compiled in acpi namespace so this shows up as acpi.ec_delay param */8685static unsigned int ec_delay __read_mostly = ACPI_EC_DELAY;···116109 u8 ri;117110 u8 wlen;118111 u8 rlen;119119- bool done;112112+ u8 flags;120113};121114122115struct acpi_ec *boot_ec, *first_ec;···134127static inline u8 acpi_ec_read_status(struct acpi_ec *ec)135128{136129 u8 x = inb(ec->command_addr);137137- pr_debug("---> status = 0x%2.2x\n", x);130130+ pr_debug("EC_SC(R) = 0x%2.2x "131131+ "SCI_EVT=%d BURST=%d CMD=%d IBF=%d OBF=%d\n",132132+ x,133133+ !!(x & ACPI_EC_FLAG_SCI),134134+ !!(x & ACPI_EC_FLAG_BURST),135135+ !!(x & ACPI_EC_FLAG_CMD),136136+ !!(x & ACPI_EC_FLAG_IBF),137137+ !!(x & ACPI_EC_FLAG_OBF));138138 return x;139139}140140141141static inline u8 acpi_ec_read_data(struct acpi_ec *ec)142142{143143 u8 x = inb(ec->data_addr);144144- pr_debug("---> data = 0x%2.2x\n", x);144144+ pr_debug("EC_DATA(R) = 0x%2.2x\n", x);145145 return x;146146}147147148148static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)149149{150150- pr_debug("<--- command = 0x%2.2x\n", command);150150+ pr_debug("EC_SC(W) = 0x%2.2x\n", command);151151 outb(command, ec->command_addr);152152}153153154154static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)155155{156156- pr_debug("<--- data = 0x%2.2x\n", data);156156+ pr_debug("EC_DATA(W) = 0x%2.2x\n", data);157157 outb(data, ec->data_addr);158158}159159160160-static int ec_transaction_done(struct acpi_ec *ec)160160+static int ec_transaction_completed(struct acpi_ec *ec)161161{162162 unsigned long flags;163163 int ret = 0;164164 spin_lock_irqsave(&ec->lock, flags);165165- if (!ec->curr || ec->curr->done)165165+ if (ec->curr && (ec->curr->flags & ACPI_EC_COMMAND_COMPLETE))166166 ret = 1;167167 spin_unlock_irqrestore(&ec->lock, flags);168168 return ret;169169}170170171171-static void start_transaction(struct acpi_ec *ec)171171+static bool advance_transaction(struct acpi_ec *ec)172172{173173- ec->curr->irq_count = ec->curr->wi = ec->curr->ri = 0;174174- ec->curr->done = false;175175- acpi_ec_write_cmd(ec, ec->curr->command);176176-}177177-178178-static void advance_transaction(struct acpi_ec *ec, u8 status)179179-{180180- unsigned long flags;181173 struct transaction *t;174174+ u8 status;175175+ bool wakeup = false;182176183183- spin_lock_irqsave(&ec->lock, flags);177177+ pr_debug("===== %s =====\n", in_interrupt() ? "IRQ" : "TASK");178178+ status = acpi_ec_read_status(ec);184179 t = ec->curr;185180 if (!t)186186- goto unlock;187187- if (t->wlen > t->wi) {188188- if ((status & ACPI_EC_FLAG_IBF) == 0)189189- acpi_ec_write_data(ec,190190- t->wdata[t->wi++]);191191- else192192- goto err;193193- } else if (t->rlen > t->ri) {194194- if ((status & ACPI_EC_FLAG_OBF) == 1) {195195- t->rdata[t->ri++] = acpi_ec_read_data(ec);196196- if (t->rlen == t->ri)197197- t->done = true;181181+ goto err;182182+ if (t->flags & ACPI_EC_COMMAND_POLL) {183183+ if (t->wlen > t->wi) {184184+ if ((status & ACPI_EC_FLAG_IBF) == 0)185185+ acpi_ec_write_data(ec, t->wdata[t->wi++]);186186+ else187187+ goto err;188188+ } else if (t->rlen > t->ri) {189189+ if ((status & ACPI_EC_FLAG_OBF) == 1) {190190+ t->rdata[t->ri++] = acpi_ec_read_data(ec);191191+ if (t->rlen == t->ri) {192192+ t->flags |= ACPI_EC_COMMAND_COMPLETE;193193+ wakeup = true;194194+ }195195+ } else196196+ goto err;197197+ } else if (t->wlen == t->wi &&198198+ (status & ACPI_EC_FLAG_IBF) == 0) {199199+ t->flags |= ACPI_EC_COMMAND_COMPLETE;200200+ wakeup = true;201201+ }202202+ return wakeup;203203+ } else {204204+ if ((status & ACPI_EC_FLAG_IBF) == 0) {205205+ acpi_ec_write_cmd(ec, t->command);206206+ t->flags |= ACPI_EC_COMMAND_POLL;198207 } else199208 goto err;200200- } else if (t->wlen == t->wi &&201201- (status & ACPI_EC_FLAG_IBF) == 0)202202- t->done = true;203203- goto unlock;209209+ return wakeup;210210+ }204211err:205212 /*206213 * If SCI bit is set, then don't think it's a false IRQ207214 * otherwise will take a not handled IRQ as a false one.208215 */209209- if (in_interrupt() && !(status & ACPI_EC_FLAG_SCI))210210- ++t->irq_count;216216+ if (!(status & ACPI_EC_FLAG_SCI)) {217217+ if (in_interrupt() && t)218218+ ++t->irq_count;219219+ }220220+ return wakeup;221221+}211222212212-unlock:213213- spin_unlock_irqrestore(&ec->lock, flags);223223+static void start_transaction(struct acpi_ec *ec)224224+{225225+ ec->curr->irq_count = ec->curr->wi = ec->curr->ri = 0;226226+ ec->curr->flags = 0;227227+ (void)advance_transaction(ec);214228}215229216230static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data);···256228 /* don't sleep with disabled interrupts */257229 if (EC_FLAGS_MSI || irqs_disabled()) {258230 udelay(ACPI_EC_MSI_UDELAY);259259- if (ec_transaction_done(ec))231231+ if (ec_transaction_completed(ec))260232 return 0;261233 } else {262234 if (wait_event_timeout(ec->wait,263263- ec_transaction_done(ec),235235+ ec_transaction_completed(ec),264236 msecs_to_jiffies(1)))265237 return 0;266238 }267267- advance_transaction(ec, acpi_ec_read_status(ec));239239+ spin_lock_irqsave(&ec->lock, flags);240240+ (void)advance_transaction(ec);241241+ spin_unlock_irqrestore(&ec->lock, flags);268242 } while (time_before(jiffies, delay));269243 pr_debug("controller reset, restart transaction\n");270244 spin_lock_irqsave(&ec->lock, flags);···298268 return ret;299269}300270301301-static int ec_check_ibf0(struct acpi_ec *ec)302302-{303303- u8 status = acpi_ec_read_status(ec);304304- return (status & ACPI_EC_FLAG_IBF) == 0;305305-}306306-307307-static int ec_wait_ibf0(struct acpi_ec *ec)308308-{309309- unsigned long delay = jiffies + msecs_to_jiffies(ec_delay);310310- /* interrupt wait manually if GPE mode is not active */311311- while (time_before(jiffies, delay))312312- if (wait_event_timeout(ec->wait, ec_check_ibf0(ec),313313- msecs_to_jiffies(1)))314314- return 0;315315- return -ETIME;316316-}317317-318271static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)319272{320273 int status;···317304 status = -ENODEV;318305 goto unlock;319306 }320320- }321321- if (ec_wait_ibf0(ec)) {322322- pr_err("input buffer is not empty, "323323- "aborting transaction\n");324324- status = -ETIME;325325- goto end;326307 }327308 pr_debug("transaction start (cmd=0x%02x, addr=0x%02x)\n",328309 t->command, t->wdata ? t->wdata[0] : 0);···341334 set_bit(EC_FLAGS_GPE_STORM, &ec->flags);342335 }343336 pr_debug("transaction end\n");344344-end:345337 if (ec->global_lock)346338 acpi_release_global_lock(glk);347339unlock:···640634static u32 acpi_ec_gpe_handler(acpi_handle gpe_device,641635 u32 gpe_number, void *data)642636{637637+ unsigned long flags;643638 struct acpi_ec *ec = data;644644- u8 status = acpi_ec_read_status(ec);645639646646- pr_debug("~~~> interrupt, status:0x%02x\n", status);647647-648648- advance_transaction(ec, status);649649- if (ec_transaction_done(ec) &&650650- (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) == 0) {640640+ spin_lock_irqsave(&ec->lock, flags);641641+ if (advance_transaction(ec))651642 wake_up(&ec->wait);652652- ec_check_sci(ec, acpi_ec_read_status(ec));653653- }643643+ spin_unlock_irqrestore(&ec->lock, flags);644644+ ec_check_sci(ec, acpi_ec_read_status(ec));654645 return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE;655646}656647···10691066 /* fall through */10701067 }1071106810721072- if (EC_FLAGS_SKIP_DSDT_SCAN)10691069+ if (EC_FLAGS_SKIP_DSDT_SCAN) {10701070+ kfree(saved_ec);10731071 return -ENODEV;10721072+ }1074107310751074 /* This workaround is needed only on some broken machines,10761075 * which require early EC, but fail to provide ECDT */···11101105 }11111106error:11121107 kfree(boot_ec);11081108+ kfree(saved_ec);11131109 boot_ec = NULL;11141110 return -ENODEV;11151111}
+5-5
drivers/acpi/resource.c
···7777 switch (ares->type) {7878 case ACPI_RESOURCE_TYPE_MEMORY24:7979 memory24 = &ares->data.memory24;8080- if (!memory24->address_length)8080+ if (!memory24->minimum && !memory24->address_length)8181 return false;8282 acpi_dev_get_memresource(res, memory24->minimum,8383 memory24->address_length,···8585 break;8686 case ACPI_RESOURCE_TYPE_MEMORY32:8787 memory32 = &ares->data.memory32;8888- if (!memory32->address_length)8888+ if (!memory32->minimum && !memory32->address_length)8989 return false;9090 acpi_dev_get_memresource(res, memory32->minimum,9191 memory32->address_length,···9393 break;9494 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:9595 fixed_memory32 = &ares->data.fixed_memory32;9696- if (!fixed_memory32->address_length)9696+ if (!fixed_memory32->address && !fixed_memory32->address_length)9797 return false;9898 acpi_dev_get_memresource(res, fixed_memory32->address,9999 fixed_memory32->address_length,···150150 switch (ares->type) {151151 case ACPI_RESOURCE_TYPE_IO:152152 io = &ares->data.io;153153- if (!io->address_length)153153+ if (!io->minimum && !io->address_length)154154 return false;155155 acpi_dev_get_ioresource(res, io->minimum,156156 io->address_length,···158158 break;159159 case ACPI_RESOURCE_TYPE_FIXED_IO:160160 fixed_io = &ares->data.fixed_io;161161- if (!fixed_io->address_length)161161+ if (!fixed_io->address && !fixed_io->address_length)162162 return false;163163 acpi_dev_get_ioresource(res, fixed_io->address,164164 fixed_io->address_length,
···7878struct xgene_ahci_context {7979 struct ahci_host_priv *hpriv;8080 struct device *dev;8181+ u8 last_cmd[MAX_AHCI_CHN_PERCTR]; /* tracking the last command issued*/8182 void __iomem *csr_core; /* Core CSR address of IP */8283 void __iomem *csr_diag; /* Diag CSR address of IP */8384 void __iomem *csr_axi; /* AXI CSR address of IP */···9998}10099101100/**101101+ * xgene_ahci_restart_engine - Restart the dma engine.102102+ * @ap : ATA port of interest103103+ *104104+ * Restarts the dma engine inside the controller.105105+ */106106+static int xgene_ahci_restart_engine(struct ata_port *ap)107107+{108108+ struct ahci_host_priv *hpriv = ap->host->private_data;109109+110110+ ahci_stop_engine(ap);111111+ ahci_start_fis_rx(ap);112112+ hpriv->start_engine(ap);113113+114114+ return 0;115115+}116116+117117+/**118118+ * xgene_ahci_qc_issue - Issue commands to the device119119+ * @qc: Command to issue120120+ *121121+ * Due to Hardware errata for IDENTIFY DEVICE command, the controller cannot122122+ * clear the BSY bit after receiving the PIO setup FIS. This results in the dma123123+ * state machine goes into the CMFatalErrorUpdate state and locks up. By124124+ * restarting the dma engine, it removes the controller out of lock up state.125125+ */126126+static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc)127127+{128128+ struct ata_port *ap = qc->ap;129129+ struct ahci_host_priv *hpriv = ap->host->private_data;130130+ struct xgene_ahci_context *ctx = hpriv->plat_data;131131+ int rc = 0;132132+133133+ if (unlikely(ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA))134134+ xgene_ahci_restart_engine(ap);135135+136136+ rc = ahci_qc_issue(qc);137137+138138+ /* Save the last command issued */139139+ ctx->last_cmd[ap->port_no] = qc->tf.command;140140+141141+ return rc;142142+}143143+144144+/**102145 * xgene_ahci_read_id - Read ID data from the specified device103146 * @dev: device104147 * @tf: proposed taskfile105148 * @id: data buffer106149 *107150 * This custom read ID function is required due to the fact that the HW108108- * does not support DEVSLP and the controller state machine may get stuck109109- * after processing the ID query command.151151+ * does not support DEVSLP.110152 */111153static unsigned int xgene_ahci_read_id(struct ata_device *dev,112154 struct ata_taskfile *tf, u16 *id)113155{114156 u32 err_mask;115115- void __iomem *port_mmio = ahci_port_base(dev->link->ap);116157117158 err_mask = ata_do_dev_read_id(dev, tf, id);118159 if (err_mask)···176133 */177134 id[ATA_ID_FEATURE_SUPP] &= ~(1 << 8);178135179179- /*180180- * Due to HW errata, restart the port if no other command active.181181- * Otherwise the controller may get stuck.182182- */183183- if (!readl(port_mmio + PORT_CMD_ISSUE)) {184184- writel(PORT_CMD_FIS_RX, port_mmio + PORT_CMD);185185- readl(port_mmio + PORT_CMD); /* Force a barrier */186186- writel(PORT_CMD_FIS_RX | PORT_CMD_START, port_mmio + PORT_CMD);187187- readl(port_mmio + PORT_CMD); /* Force a barrier */188188- }189136 return 0;190137}191138···333300 .host_stop = xgene_ahci_host_stop,334301 .hardreset = xgene_ahci_hardreset,335302 .read_id = xgene_ahci_read_id,303303+ .qc_issue = xgene_ahci_qc_issue,336304};337305338306static const struct ata_port_info xgene_ahci_port_info = {
+4-3
drivers/ata/libahci.c
···68686969static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);7070static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);7171-static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc);7271static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc);7372static int ahci_port_start(struct ata_port *ap);7473static void ahci_port_stop(struct ata_port *ap);···619620}620621EXPORT_SYMBOL_GPL(ahci_stop_engine);621622622622-static void ahci_start_fis_rx(struct ata_port *ap)623623+void ahci_start_fis_rx(struct ata_port *ap)623624{624625 void __iomem *port_mmio = ahci_port_base(ap);625626 struct ahci_host_priv *hpriv = ap->host->private_data;···645646 /* flush */646647 readl(port_mmio + PORT_CMD);647648}649649+EXPORT_SYMBOL_GPL(ahci_start_fis_rx);648650649651static int ahci_stop_fis_rx(struct ata_port *ap)650652{···19451945}19461946EXPORT_SYMBOL_GPL(ahci_interrupt);1947194719481948-static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)19481948+unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)19491949{19501950 struct ata_port *ap = qc->ap;19511951 void __iomem *port_mmio = ahci_port_base(ap);···1974197419751975 return 0;19761976}19771977+EXPORT_SYMBOL_GPL(ahci_qc_issue);1977197819781979static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc)19791980{
+6-1
drivers/ata/libahci_platform.c
···250250 if (IS_ERR(hpriv->phy)) {251251 rc = PTR_ERR(hpriv->phy);252252 switch (rc) {253253- case -ENODEV:254253 case -ENOSYS:254254+ /* No PHY support. Check if PHY is required. */255255+ if (of_find_property(dev->of_node, "phys", NULL)) {256256+ dev_err(dev, "couldn't get sata-phy: ENOSYS\n");257257+ goto err_out;258258+ }259259+ case -ENODEV:255260 /* continue normally */256261 hpriv->phy = NULL;257262 break;
+3-1
drivers/char/i8k.c
···138138 if (!alloc_cpumask_var(&old_mask, GFP_KERNEL))139139 return -ENOMEM;140140 cpumask_copy(old_mask, ¤t->cpus_allowed);141141- set_cpus_allowed_ptr(current, cpumask_of(0));141141+ rc = set_cpus_allowed_ptr(current, cpumask_of(0));142142+ if (rc)143143+ goto out;142144 if (smp_processor_id() != 0) {143145 rc = -EBUSY;144146 goto out;
···4949# LITTLE drivers, so that it is probed last.5050obj-$(CONFIG_ARM_DT_BL_CPUFREQ) += arm_big_little_dt.o51515252-obj-$(CONFIG_ARCH_DAVINCI_DA850) += davinci-cpufreq.o5252+obj-$(CONFIG_ARCH_DAVINCI) += davinci-cpufreq.o5353obj-$(CONFIG_UX500_SOC_DB8500) += dbx500-cpufreq.o5454obj-$(CONFIG_ARM_EXYNOS_CPUFREQ) += exynos-cpufreq.o5555obj-$(CONFIG_ARM_EXYNOS4210_CPUFREQ) += exynos4210-cpufreq.o
+22-13
drivers/cpufreq/intel_pstate.c
···128128129129struct perf_limits {130130 int no_turbo;131131+ int turbo_disabled;131132 int max_perf_pct;132133 int min_perf_pct;133134 int32_t max_perf;···288287 if (ret != 1)289288 return -EINVAL;290289 limits.no_turbo = clamp_t(int, input, 0 , 1);291291-290290+ if (limits.turbo_disabled) {291291+ pr_warn("Turbo disabled by BIOS or unavailable on processor\n");292292+ limits.no_turbo = limits.turbo_disabled;293293+ }292294 return count;293295}294296···361357{362358 u64 value;363359 rdmsrl(BYT_RATIOS, value);364364- return (value >> 8) & 0x3F;360360+ return (value >> 8) & 0x7F;365361}366362367363static int byt_get_max_pstate(void)368364{369365 u64 value;370366 rdmsrl(BYT_RATIOS, value);371371- return (value >> 16) & 0x3F;367367+ return (value >> 16) & 0x7F;372368}373369374370static int byt_get_turbo_pstate(void)375371{376372 u64 value;377373 rdmsrl(BYT_TURBO_RATIOS, value);378378- return value & 0x3F;374374+ return value & 0x7F;379375}380376381377static void byt_set_pstate(struct cpudata *cpudata, int pstate)···385381 u32 vid;386382387383 val = pstate << 8;388388- if (limits.no_turbo)384384+ if (limits.no_turbo && !limits.turbo_disabled)389385 val |= (u64)1 << 32;390386391387 vid_fp = cpudata->vid.min + mul_fp(···409405410406411407 rdmsrl(BYT_VIDS, value);412412- cpudata->vid.min = int_tofp((value >> 8) & 0x3f);413413- cpudata->vid.max = int_tofp((value >> 16) & 0x3f);408408+ cpudata->vid.min = int_tofp((value >> 8) & 0x7f);409409+ cpudata->vid.max = int_tofp((value >> 16) & 0x7f);414410 cpudata->vid.ratio = div_fp(415411 cpudata->vid.max - cpudata->vid.min,416412 int_tofp(cpudata->pstate.max_pstate -···452448 u64 val;453449454450 val = pstate << 8;455455- if (limits.no_turbo)451451+ if (limits.no_turbo && !limits.turbo_disabled)456452 val |= (u64)1 << 32;457453458454 wrmsrl_on_cpu(cpudata->cpu, MSR_IA32_PERF_CTL, val);···700696701697 cpu = all_cpu_data[cpunum];702698703703- intel_pstate_get_cpu_pstates(cpu);704704-705699 cpu->cpu = cpunum;700700+ intel_pstate_get_cpu_pstates(cpu);706701707702 init_timer_deferrable(&cpu->timer);708703 cpu->timer.function = intel_pstate_timer_func;···744741 limits.min_perf = int_tofp(1);745742 limits.max_perf_pct = 100;746743 limits.max_perf = int_tofp(1);747747- limits.no_turbo = 0;744744+ limits.no_turbo = limits.turbo_disabled;748745 return 0;749746 }750747 limits.min_perf_pct = (policy->min * 100) / policy->cpuinfo.max_freq;···787784{788785 struct cpudata *cpu;789786 int rc;787787+ u64 misc_en;790788791789 rc = intel_pstate_init_cpu(policy->cpu);792790 if (rc)···795791796792 cpu = all_cpu_data[policy->cpu];797793798798- if (!limits.no_turbo &&799799- limits.min_perf_pct == 100 && limits.max_perf_pct == 100)794794+ rdmsrl(MSR_IA32_MISC_ENABLE, misc_en);795795+ if (misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE ||796796+ cpu->pstate.max_pstate == cpu->pstate.turbo_pstate) {797797+ limits.turbo_disabled = 1;798798+ limits.no_turbo = 1;799799+ }800800+ if (limits.min_perf_pct == 100 && limits.max_perf_pct == 100)800801 policy->policy = CPUFREQ_POLICY_PERFORMANCE;801802 else802803 policy->policy = CPUFREQ_POLICY_POWERSAVE;
+3-5
drivers/crypto/caam/jr.c
···453453 int error;454454455455 jrdev = &pdev->dev;456456- jrpriv = kmalloc(sizeof(struct caam_drv_private_jr),457457- GFP_KERNEL);456456+ jrpriv = devm_kmalloc(jrdev, sizeof(struct caam_drv_private_jr),457457+ GFP_KERNEL);458458 if (!jrpriv)459459 return -ENOMEM;460460···487487488488 /* Now do the platform independent part */489489 error = caam_jr_init(jrdev); /* now turn on hardware */490490- if (error) {491491- kfree(jrpriv);490490+ if (error)492491 return error;493493- }494492495493 jrpriv->dev = jrdev;496494 spin_lock(&driver_data.jr_alloc_lock);
···14641464#else14651465static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)14661466{14671467- int ret;14671467+ int ret = 0;1468146814691469 DRM_INFO("Replacing VGA console driver\n");1470147014711471 console_lock();14721472- ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);14721472+ if (con_is_bound(&vga_con))14731473+ ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);14731474 if (ret == 0) {14741475 ret = do_unregister_con_driver(&vga_con);14751476
···403403404404 DRM_DEBUG_DRIVER("bclp = 0x%08x\n", bclp);405405406406+ /*407407+ * If the acpi_video interface is not supposed to be used, don't408408+ * bother processing backlight level change requests from firmware.409409+ */410410+ if (!acpi_video_verify_backlight_support()) {411411+ DRM_DEBUG_KMS("opregion backlight request ignored\n");412412+ return 0;413413+ }414414+406415 if (!(bclp & ASLE_BCLP_VALID))407416 return ASLC_BACKLIGHT_FAILED;408417
+6-2
drivers/gpu/drm/i915/intel_panel.c
···11181118 int ret;1119111911201120 if (!dev_priv->vbt.backlight.present) {11211121- DRM_DEBUG_KMS("native backlight control not available per VBT\n");11221122- return 0;11211121+ if (dev_priv->quirks & QUIRK_BACKLIGHT_PRESENT) {11221122+ DRM_DEBUG_KMS("no backlight present per VBT, but present per quirk\n");11231123+ } else {11241124+ DRM_DEBUG_KMS("no backlight present per VBT\n");11251125+ return 0;11261126+ }11231127 }1124112811251129 /* set level and max in panel struct */
···652652 ret = nouveau_do_resume(drm_dev);653653 if (ret)654654 return ret;655655- if (drm_dev->mode_config.num_crtc)656656- nouveau_fbcon_set_suspend(drm_dev, 0);657655658658- nouveau_fbcon_zfill_all(drm_dev);659659- if (drm_dev->mode_config.num_crtc)656656+ if (drm_dev->mode_config.num_crtc) {660657 nouveau_display_resume(drm_dev);658658+ nouveau_fbcon_set_suspend(drm_dev, 0);659659+ }660660+661661 return 0;662662}663663···683683 ret = nouveau_do_resume(drm_dev);684684 if (ret)685685 return ret;686686- if (drm_dev->mode_config.num_crtc)687687- nouveau_fbcon_set_suspend(drm_dev, 0);688688- nouveau_fbcon_zfill_all(drm_dev);689689- if (drm_dev->mode_config.num_crtc)686686+687687+ if (drm_dev->mode_config.num_crtc) {690688 nouveau_display_resume(drm_dev);689689+ nouveau_fbcon_set_suspend(drm_dev, 0);690690+ }691691+691692 return 0;692693}693694
+3-10
drivers/gpu/drm/nouveau/nouveau_fbcon.c
···531531 if (state == 1)532532 nouveau_fbcon_save_disable_accel(dev);533533 fb_set_suspend(drm->fbcon->helper.fbdev, state);534534- if (state == 0)534534+ if (state == 0) {535535 nouveau_fbcon_restore_accel(dev);536536+ nouveau_fbcon_zfill(dev, drm->fbcon);537537+ }536538 console_unlock();537537- }538538-}539539-540540-void541541-nouveau_fbcon_zfill_all(struct drm_device *dev)542542-{543543- struct nouveau_drm *drm = nouveau_drm(dev);544544- if (drm->fbcon) {545545- nouveau_fbcon_zfill(dev, drm->fbcon);546539 }547540}
···127127 /* flags not zero */128128 if (args.v1.ucReplyStatus == 2) {129129 DRM_DEBUG_KMS("dp_aux_ch flags not zero\n");130130- r = -EBUSY;130130+ r = -EIO;131131 goto done;132132 }133133
···40404141config I2C_MUX_PCA954x4242 tristate "Philips PCA954x I2C Mux/switches"4343+ depends on GPIOLIB4344 help4445 If you say yes here you get support for the Philips PCA954x4546 I2C mux/switch devices.
+2-5
drivers/iio/accel/hid-sensor-accel-3d.c
···110110 struct accel_3d_state *accel_state = iio_priv(indio_dev);111111 int report_id = -1;112112 u32 address;113113- int ret;114113 int ret_type;115114 s32 poll_value;116115···150151 ret_type = IIO_VAL_INT;151152 break;152153 case IIO_CHAN_INFO_SAMP_FREQ:153153- ret = hid_sensor_read_samp_freq_value(154154+ ret_type = hid_sensor_read_samp_freq_value(154155 &accel_state->common_attributes, val, val2);155155- ret_type = IIO_VAL_INT_PLUS_MICRO;156156 break;157157 case IIO_CHAN_INFO_HYSTERESIS:158158- ret = hid_sensor_read_raw_hyst_value(158158+ ret_type = hid_sensor_read_raw_hyst_value(159159 &accel_state->common_attributes, val, val2);160160- ret_type = IIO_VAL_INT_PLUS_MICRO;161160 break;162161 default:163162 ret_type = -EINVAL;
+1-1
drivers/iio/adc/ti_am335x_adc.c
···374374 return -EAGAIN;375375 }376376 }377377- map_val = chan->channel + TOTAL_CHANNELS;377377+ map_val = adc_dev->channel_step[chan->scan_index];378378379379 /*380380 * We check the complete FIFO. We programmed just one entry but in case
+2-5
drivers/iio/gyro/hid-sensor-gyro-3d.c
···110110 struct gyro_3d_state *gyro_state = iio_priv(indio_dev);111111 int report_id = -1;112112 u32 address;113113- int ret;114113 int ret_type;115114 s32 poll_value;116115···150151 ret_type = IIO_VAL_INT;151152 break;152153 case IIO_CHAN_INFO_SAMP_FREQ:153153- ret = hid_sensor_read_samp_freq_value(154154+ ret_type = hid_sensor_read_samp_freq_value(154155 &gyro_state->common_attributes, val, val2);155155- ret_type = IIO_VAL_INT_PLUS_MICRO;156156 break;157157 case IIO_CHAN_INFO_HYSTERESIS:158158- ret = hid_sensor_read_raw_hyst_value(158158+ ret_type = hid_sensor_read_raw_hyst_value(159159 &gyro_state->common_attributes, val, val2);160160- ret_type = IIO_VAL_INT_PLUS_MICRO;161160 break;162161 default:163162 ret_type = -EINVAL;
+2-5
drivers/iio/light/hid-sensor-als.c
···7979 struct als_state *als_state = iio_priv(indio_dev);8080 int report_id = -1;8181 u32 address;8282- int ret;8382 int ret_type;8483 s32 poll_value;8584···128129 ret_type = IIO_VAL_INT;129130 break;130131 case IIO_CHAN_INFO_SAMP_FREQ:131131- ret = hid_sensor_read_samp_freq_value(132132+ ret_type = hid_sensor_read_samp_freq_value(132133 &als_state->common_attributes, val, val2);133133- ret_type = IIO_VAL_INT_PLUS_MICRO;134134 break;135135 case IIO_CHAN_INFO_HYSTERESIS:136136- ret = hid_sensor_read_raw_hyst_value(136136+ ret_type = hid_sensor_read_raw_hyst_value(137137 &als_state->common_attributes, val, val2);138138- ret_type = IIO_VAL_INT_PLUS_MICRO;139138 break;140139 default:141140 ret_type = -EINVAL;
+2-5
drivers/iio/light/hid-sensor-prox.c
···7474 struct prox_state *prox_state = iio_priv(indio_dev);7575 int report_id = -1;7676 u32 address;7777- int ret;7877 int ret_type;7978 s32 poll_value;8079···124125 ret_type = IIO_VAL_INT;125126 break;126127 case IIO_CHAN_INFO_SAMP_FREQ:127127- ret = hid_sensor_read_samp_freq_value(128128+ ret_type = hid_sensor_read_samp_freq_value(128129 &prox_state->common_attributes, val, val2);129129- ret_type = IIO_VAL_INT_PLUS_MICRO;130130 break;131131 case IIO_CHAN_INFO_HYSTERESIS:132132- ret = hid_sensor_read_raw_hyst_value(132132+ ret_type = hid_sensor_read_raw_hyst_value(133133 &prox_state->common_attributes, val, val2);134134- ret_type = IIO_VAL_INT_PLUS_MICRO;135134 break;136135 default:137136 ret_type = -EINVAL;
+10-1
drivers/iio/light/tcs3472.c
···52525353struct tcs3472_data {5454 struct i2c_client *client;5555+ struct mutex lock;5556 u8 enable;5657 u8 control;5758 u8 atime;···117116118117 switch (mask) {119118 case IIO_CHAN_INFO_RAW:119119+ if (iio_buffer_enabled(indio_dev))120120+ return -EBUSY;121121+122122+ mutex_lock(&data->lock);120123 ret = tcs3472_req_data(data);121121- if (ret < 0)124124+ if (ret < 0) {125125+ mutex_unlock(&data->lock);122126 return ret;127127+ }123128 ret = i2c_smbus_read_word_data(data->client, chan->address);129129+ mutex_unlock(&data->lock);124130 if (ret < 0)125131 return ret;126132 *val = ret;···263255 data = iio_priv(indio_dev);264256 i2c_set_clientdata(client, indio_dev);265257 data->client = client;258258+ mutex_init(&data->lock);266259267260 indio_dev->dev.parent = &client->dev;268261 indio_dev->info = &tcs3472_info;
+2-5
drivers/iio/magnetometer/hid-sensor-magn-3d.c
···110110 struct magn_3d_state *magn_state = iio_priv(indio_dev);111111 int report_id = -1;112112 u32 address;113113- int ret;114113 int ret_type;115114 s32 poll_value;116115···152153 ret_type = IIO_VAL_INT;153154 break;154155 case IIO_CHAN_INFO_SAMP_FREQ:155155- ret = hid_sensor_read_samp_freq_value(156156+ ret_type = hid_sensor_read_samp_freq_value(156157 &magn_state->common_attributes, val, val2);157157- ret_type = IIO_VAL_INT_PLUS_MICRO;158158 break;159159 case IIO_CHAN_INFO_HYSTERESIS:160160- ret = hid_sensor_read_raw_hyst_value(160160+ ret_type = hid_sensor_read_raw_hyst_value(161161 &magn_state->common_attributes, val, val2);162162- ret_type = IIO_VAL_INT_PLUS_MICRO;163162 break;164163 default:165164 ret_type = -EINVAL;
+2-5
drivers/iio/pressure/hid-sensor-press.c
···7878 struct press_state *press_state = iio_priv(indio_dev);7979 int report_id = -1;8080 u32 address;8181- int ret;8281 int ret_type;8382 s32 poll_value;8483···127128 ret_type = IIO_VAL_INT;128129 break;129130 case IIO_CHAN_INFO_SAMP_FREQ:130130- ret = hid_sensor_read_samp_freq_value(131131+ ret_type = hid_sensor_read_samp_freq_value(131132 &press_state->common_attributes, val, val2);132132- ret_type = IIO_VAL_INT_PLUS_MICRO;133133 break;134134 case IIO_CHAN_INFO_HYSTERESIS:135135- ret = hid_sensor_read_raw_hyst_value(135135+ ret_type = hid_sensor_read_raw_hyst_value(136136 &press_state->common_attributes, val, val2);137137- ret_type = IIO_VAL_INT_PLUS_MICRO;138137 break;139138 default:140139 ret_type = -EINVAL;
+2-2
drivers/md/dm-crypt.c
···11/*22- * Copyright (C) 2003 Christophe Saout <christophe@saout.de>22+ * Copyright (C) 2003 Jana Saout <jana@saout.de>33 * Copyright (C) 2004 Clemens Fruhwirth <clemens@endorphin.org>44 * Copyright (C) 2006-2009 Red Hat, Inc. All rights reserved.55 * Copyright (C) 2013 Milan Broz <gmazyland@gmail.com>···19961996module_init(dm_crypt_init);19971997module_exit(dm_crypt_exit);1998199819991999-MODULE_AUTHOR("Christophe Saout <christophe@saout.de>");19991999+MODULE_AUTHOR("Jana Saout <jana@saout.de>");20002000MODULE_DESCRIPTION(DM_NAME " target for transparent encryption / decryption");20012001MODULE_LICENSE("GPL");
···1611161116121612 spin_lock_irqsave(&m->lock, flags);1613161316141614- /* pg_init in progress, requeue until done */16151615- if (!pg_ready(m)) {16141614+ /* pg_init in progress or no paths available */16151615+ if (m->pg_init_in_progress ||16161616+ (!m->nr_valid_paths && m->queue_if_no_path)) {16161617 busy = 1;16171618 goto out;16181619 }
+2-2
drivers/md/dm-zero.c
···11/*22- * Copyright (C) 2003 Christophe Saout <christophe@saout.de>22+ * Copyright (C) 2003 Jana Saout <jana@saout.de>33 *44 * This file is released under the GPL.55 */···7979module_init(dm_zero_init)8080module_exit(dm_zero_exit)81818282-MODULE_AUTHOR("Christophe Saout <christophe@saout.de>");8282+MODULE_AUTHOR("Jana Saout <jana@saout.de>");8383MODULE_DESCRIPTION(DM_NAME " dummy target returning zeros");8484MODULE_LICENSE("GPL");
+13-2
drivers/md/dm.c
···54545555static DECLARE_WORK(deferred_remove_work, do_deferred_remove);56565757+static struct workqueue_struct *deferred_remove_workqueue;5858+5759/*5860 * For bio-based dm.5961 * One of these is allocated per bio.···278276 if (r)279277 goto out_free_rq_tio_cache;280278279279+ deferred_remove_workqueue = alloc_workqueue("kdmremove", WQ_UNBOUND, 1);280280+ if (!deferred_remove_workqueue) {281281+ r = -ENOMEM;282282+ goto out_uevent_exit;283283+ }284284+281285 _major = major;282286 r = register_blkdev(_major, _name);283287 if (r < 0)284284- goto out_uevent_exit;288288+ goto out_free_workqueue;285289286290 if (!_major)287291 _major = r;288292289293 return 0;290294295295+out_free_workqueue:296296+ destroy_workqueue(deferred_remove_workqueue);291297out_uevent_exit:292298 dm_uevent_exit();293299out_free_rq_tio_cache:···309299static void local_exit(void)310300{311301 flush_scheduled_work();302302+ destroy_workqueue(deferred_remove_workqueue);312303313304 kmem_cache_destroy(_rq_tio_cache);314305 kmem_cache_destroy(_io_cache);···418407419408 if (atomic_dec_and_test(&md->open_count) &&420409 (test_bit(DMF_DEFERRED_REMOVE, &md->flags)))421421- schedule_work(&deferred_remove_work);410410+ queue_work(deferred_remove_workqueue, &deferred_remove_work);422411423412 dm_put(md);424413
+7-2
drivers/pci/pci.c
···31353135 if (probe)31363136 return 0;3137313731383138- /* Wait for Transaction Pending bit clean */31393139- if (pci_wait_for_pending(dev, pos + PCI_AF_STATUS, PCI_AF_STATUS_TP))31383138+ /*31393139+ * Wait for Transaction Pending bit to clear. A word-aligned test31403140+ * is used, so we use the conrol offset rather than status and shift31413141+ * the test bit to match.31423142+ */31433143+ if (pci_wait_for_pending(dev, pos + PCI_AF_CTRL,31443144+ PCI_AF_STATUS_TP << 8))31403145 goto clear;3141314631423147 dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n");
+2
drivers/phy/Kconfig
···112112config PHY_SUN4I_USB113113 tristate "Allwinner sunxi SoC USB PHY driver"114114 depends on ARCH_SUNXI && HAS_IOMEM && OF115115+ depends on RESET_CONTROLLER115116 select GENERIC_PHY116117 help117118 Enable this to support the transceiver that is part of Allwinner···123122124123config PHY_SAMSUNG_USB2125124 tristate "Samsung USB 2.0 PHY driver"125125+ depends on HAS_IOMEM126126 select GENERIC_PHY127127 select MFD_SYSCON128128 help
···306306{307307 struct imx_thermal_data *data = platform_get_drvdata(pdev);308308 struct regmap *map;309309- int t1, t2, n1, n2;309309+ int t1, n1;310310 int ret;311311 u32 val;312312 u64 temp64;···333333 /*334334 * Sensor data layout:335335 * [31:20] - sensor value @ 25C336336- * [19:8] - sensor value of hot337337- * [7:0] - hot temperature value338336 * Use universal formula now and only need sensor value @ 25C339337 * slope = 0.4297157 - (0.0015976 * 25C fuse)340338 */341339 n1 = val >> 20;342342- n2 = (val & 0xfff00) >> 8;343343- t2 = val & 0xff;344340 t1 = 25; /* t1 always 25C */345341346342 /*···362366 data->c2 = n1 * data->c1 + 1000 * t1;363367364368 /*365365- * Set the default passive cooling trip point to 20 °C below the366366- * maximum die temperature. Can be changed from userspace.369369+ * Set the default passive cooling trip point,370370+ * can be changed from userspace.367371 */368368- data->temp_passive = 1000 * (t2 - 20);372372+ data->temp_passive = IMX_TEMP_PASSIVE;369373370374 /*371371- * The maximum die temperature is t2, let's give 5 °C cushion372372- * for noise and possible temperature rise between measurements.375375+ * The maximum die temperature set to 20 C higher than376376+ * IMX_TEMP_PASSIVE.373377 */374374- data->temp_critical = 1000 * (t2 - 5);378378+ data->temp_critical = 1000 * 20 + data->temp_passive;375379376380 return 0;377381}
+4-3
drivers/thermal/of-thermal.c
···156156157157 ret = thermal_zone_bind_cooling_device(thermal,158158 tbp->trip_id, cdev,159159- tbp->min,160160- tbp->max);159159+ tbp->max,160160+ tbp->min);161161 if (ret)162162 return ret;163163 }···712712 }713713714714 i = 0;715715- for_each_child_of_node(child, gchild)715715+ for_each_child_of_node(child, gchild) {716716 ret = thermal_of_populate_bind_params(gchild, &tz->tbps[i++],717717 tz->trips, tz->ntrips);718718 if (ret)719719 goto free_tbps;720720+ }720721721722finish:722723 of_node_put(child);
+18-15
drivers/thermal/thermal_hwmon.c
···140140 return NULL;141141}142142143143+static bool thermal_zone_crit_temp_valid(struct thermal_zone_device *tz)144144+{145145+ unsigned long temp;146146+ return tz->ops->get_crit_temp && !tz->ops->get_crit_temp(tz, &temp);147147+}148148+143149int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)144150{145151 struct thermal_hwmon_device *hwmon;···195189 if (result)196190 goto free_temp_mem;197191198198- if (tz->ops->get_crit_temp) {199199- unsigned long temperature;200200- if (!tz->ops->get_crit_temp(tz, &temperature)) {201201- snprintf(temp->temp_crit.name,202202- sizeof(temp->temp_crit.name),192192+ if (thermal_zone_crit_temp_valid(tz)) {193193+ snprintf(temp->temp_crit.name,194194+ sizeof(temp->temp_crit.name),203195 "temp%d_crit", hwmon->count);204204- temp->temp_crit.attr.attr.name = temp->temp_crit.name;205205- temp->temp_crit.attr.attr.mode = 0444;206206- temp->temp_crit.attr.show = temp_crit_show;207207- sysfs_attr_init(&temp->temp_crit.attr.attr);208208- result = device_create_file(hwmon->device,209209- &temp->temp_crit.attr);210210- if (result)211211- goto unregister_input;212212- }196196+ temp->temp_crit.attr.attr.name = temp->temp_crit.name;197197+ temp->temp_crit.attr.attr.mode = 0444;198198+ temp->temp_crit.attr.show = temp_crit_show;199199+ sysfs_attr_init(&temp->temp_crit.attr.attr);200200+ result = device_create_file(hwmon->device,201201+ &temp->temp_crit.attr);202202+ if (result)203203+ goto unregister_input;213204 }214205215206 mutex_lock(&thermal_hwmon_list_lock);···253250 }254251255252 device_remove_file(hwmon->device, &temp->temp_input.attr);256256- if (tz->ops->get_crit_temp)253253+ if (thermal_zone_crit_temp_valid(tz))257254 device_remove_file(hwmon->device, &temp->temp_crit.attr);258255259256 mutex_lock(&thermal_hwmon_list_lock);
+1-1
drivers/thermal/ti-soc-thermal/ti-bandgap.c
···11551155 /* register shadow for context save and restore */11561156 bgp->regval = devm_kzalloc(&pdev->dev, sizeof(*bgp->regval) *11571157 bgp->conf->sensor_count, GFP_KERNEL);11581158- if (!bgp) {11581158+ if (!bgp->regval) {11591159 dev_err(&pdev->dev, "Unable to allocate mem for driver ref\n");11601160 return ERR_PTR(-ENOMEM);11611161 }
···219219obj-y += $(patsubst %,%.gen.o, $(fw-external-y))220220obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y))221221222222+ifeq ($(KBUILD_SRC),)223223+# Makefile.build only creates subdirectories for O= builds, but external224224+# firmware might live outside the kernel source tree225225+_dummy := $(foreach d,$(addprefix $(obj)/,$(dir $(fw-external-y))), $(shell [ -d $(d) ] || mkdir -p $(d)))226226+endif227227+222228# Remove .S files and binaries created from ihex223229# (during 'make clean' .config isn't included so they're all in $(fw-shipped-))224230targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \
+2-2
fs/ext4/extents_status.c
···966966 continue;967967 }968968969969- if (ei->i_es_lru_nr == 0 || ei == locked_ei)969969+ if (ei->i_es_lru_nr == 0 || ei == locked_ei ||970970+ !write_trylock(&ei->i_es_lock))970971 continue;971972972972- write_lock(&ei->i_es_lock);973973 shrunk = __es_try_to_reclaim_extents(ei, nr_to_scan);974974 if (ei->i_es_lru_nr == 0)975975 list_del_init(&ei->i_es_lru);
+8-8
fs/ext4/ialloc.c
···338338 fatal = err;339339 } else {340340 ext4_error(sb, "bit already cleared for inode %lu", ino);341341- if (!EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) {341341+ if (gdp && !EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) {342342 int count;343343 count = ext4_free_inodes_count(sb, gdp);344344 percpu_counter_sub(&sbi->s_freeinodes_counter,···874874 goto out;875875 }876876877877+ BUFFER_TRACE(group_desc_bh, "get_write_access");878878+ err = ext4_journal_get_write_access(handle, group_desc_bh);879879+ if (err) {880880+ ext4_std_error(sb, err);881881+ goto out;882882+ }883883+877884 /* We may have to initialize the block bitmap if it isn't already */878885 if (ext4_has_group_desc_csum(sb) &&879886 gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {···915908 ext4_std_error(sb, err);916909 goto out;917910 }918918- }919919-920920- BUFFER_TRACE(group_desc_bh, "get_write_access");921921- err = ext4_journal_get_write_access(handle, group_desc_bh);922922- if (err) {923923- ext4_std_error(sb, err);924924- goto out;925911 }926912927913 /* Update the relevant bg descriptor fields */
+2-2
fs/ext4/mballoc.c
···752752753753 if (free != grp->bb_free) {754754 ext4_grp_locked_error(sb, group, 0, 0,755755- "%u clusters in bitmap, %u in gd; "756756- "block bitmap corrupt.",755755+ "block bitmap and bg descriptor "756756+ "inconsistent: %u vs %u free clusters",757757 free, grp->bb_free);758758 /*759759 * If we intend to continue, we consider group descriptor
+28-32
fs/ext4/super.c
···15251525 arg = JBD2_DEFAULT_MAX_COMMIT_AGE;15261526 sbi->s_commit_interval = HZ * arg;15271527 } else if (token == Opt_max_batch_time) {15281528- if (arg == 0)15291529- arg = EXT4_DEF_MAX_BATCH_TIME;15301528 sbi->s_max_batch_time = arg;15311529 } else if (token == Opt_min_batch_time) {15321530 sbi->s_min_batch_time = arg;···28072809 es = sbi->s_es;2808281028092811 if (es->s_error_count)28102810- ext4_msg(sb, KERN_NOTICE, "error count: %u",28122812+ /* fsck newer than v1.41.13 is needed to clean this condition. */28132813+ ext4_msg(sb, KERN_NOTICE, "error count since last fsck: %u",28112814 le32_to_cpu(es->s_error_count));28122815 if (es->s_first_error_time) {28132813- printk(KERN_NOTICE "EXT4-fs (%s): initial error at %u: %.*s:%d",28162816+ printk(KERN_NOTICE "EXT4-fs (%s): initial error at time %u: %.*s:%d",28142817 sb->s_id, le32_to_cpu(es->s_first_error_time),28152818 (int) sizeof(es->s_first_error_func),28162819 es->s_first_error_func,···28252826 printk("\n");28262827 }28272828 if (es->s_last_error_time) {28282828- printk(KERN_NOTICE "EXT4-fs (%s): last error at %u: %.*s:%d",28292829+ printk(KERN_NOTICE "EXT4-fs (%s): last error at time %u: %.*s:%d",28292830 sb->s_id, le32_to_cpu(es->s_last_error_time),28302831 (int) sizeof(es->s_last_error_func),28312832 es->s_last_error_func,···38793880 goto failed_mount2;38803881 }38813882 }38823882-38833883- /*38843884- * set up enough so that it can read an inode,38853885- * and create new inode for buddy allocator38863886- */38873887- sbi->s_gdb_count = db_count;38883888- if (!test_opt(sb, NOLOAD) &&38893889- EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL))38903890- sb->s_op = &ext4_sops;38913891- else38923892- sb->s_op = &ext4_nojournal_sops;38933893-38943894- ext4_ext_init(sb);38953895- err = ext4_mb_init(sb);38963896- if (err) {38973897- ext4_msg(sb, KERN_ERR, "failed to initialize mballoc (%d)",38983898- err);38993899- goto failed_mount2;39003900- }39013901-39023883 if (!ext4_check_descriptors(sb, &first_not_zeroed)) {39033884 ext4_msg(sb, KERN_ERR, "group descriptors corrupted!");39043904- goto failed_mount2a;38853885+ goto failed_mount2;39053886 }39063887 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG))39073888 if (!ext4_fill_flex_info(sb)) {39083889 ext4_msg(sb, KERN_ERR,39093890 "unable to initialize "39103891 "flex_bg meta info!");39113911- goto failed_mount2a;38923892+ goto failed_mount2;39123893 }3913389438953895+ sbi->s_gdb_count = db_count;39143896 get_random_bytes(&sbi->s_next_generation, sizeof(u32));39153897 spin_lock_init(&sbi->s_next_gen_lock);39163898···39263946 sbi->s_stripe = ext4_get_stripe_size(sbi);39273947 sbi->s_extent_max_zeroout_kb = 32;3928394839493949+ /*39503950+ * set up enough so that it can read an inode39513951+ */39523952+ if (!test_opt(sb, NOLOAD) &&39533953+ EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL))39543954+ sb->s_op = &ext4_sops;39553955+ else39563956+ sb->s_op = &ext4_nojournal_sops;39293957 sb->s_export_op = &ext4_export_ops;39303958 sb->s_xattr = ext4_xattr_handlers;39313959#ifdef CONFIG_QUOTA···41234135 if (err) {41244136 ext4_msg(sb, KERN_ERR, "failed to reserve %llu clusters for "41254137 "reserved pool", ext4_calculate_resv_clusters(sb));41264126- goto failed_mount5;41384138+ goto failed_mount4a;41274139 }4128414041294141 err = ext4_setup_system_zone(sb);41304142 if (err) {41314143 ext4_msg(sb, KERN_ERR, "failed to initialize system "41324144 "zone (%d)", err);41454145+ goto failed_mount4a;41464146+ }41474147+41484148+ ext4_ext_init(sb);41494149+ err = ext4_mb_init(sb);41504150+ if (err) {41514151+ ext4_msg(sb, KERN_ERR, "failed to initialize mballoc (%d)",41524152+ err);41334153 goto failed_mount5;41344154 }41354155···42144218failed_mount7:42154219 ext4_unregister_li_request(sb);42164220failed_mount6:42174217- ext4_release_system_zone(sb);42214221+ ext4_mb_release(sb);42184222failed_mount5:42234223+ ext4_ext_release(sb);42244224+ ext4_release_system_zone(sb);42254225+failed_mount4a:42194226 dput(sb->s_root);42204227 sb->s_root = NULL;42214228failed_mount4:···42424243 percpu_counter_destroy(&sbi->s_extent_cache_cnt);42434244 if (sbi->s_mmp_tsk)42444245 kthread_stop(sbi->s_mmp_tsk);42454245-failed_mount2a:42464246- ext4_mb_release(sb);42474246failed_mount2:42484247 for (i = 0; i < db_count; i++)42494248 brelse(sbi->s_group_desc[i]);42504249 ext4_kvfree(sbi->s_group_desc);42514250failed_mount:42524252- ext4_ext_release(sb);42534251 if (sbi->s_chksum_driver)42544252 crypto_free_shash(sbi->s_chksum_driver);42554253 if (sbi->s_proc) {
+18-5
fs/f2fs/data.c
···608608 * b. do not use extent cache for better performance609609 * c. give the block addresses to blockdev610610 */611611-static int get_data_block(struct inode *inode, sector_t iblock,612612- struct buffer_head *bh_result, int create)611611+static int __get_data_block(struct inode *inode, sector_t iblock,612612+ struct buffer_head *bh_result, int create, bool fiemap)613613{614614 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);615615 unsigned int blkbits = inode->i_sb->s_blocksize_bits;···637637 err = 0;638638 goto unlock_out;639639 }640640- if (dn.data_blkaddr == NEW_ADDR)640640+ if (dn.data_blkaddr == NEW_ADDR && !fiemap)641641 goto put_out;642642643643 if (dn.data_blkaddr != NULL_ADDR) {···671671 err = 0;672672 goto unlock_out;673673 }674674- if (dn.data_blkaddr == NEW_ADDR)674674+ if (dn.data_blkaddr == NEW_ADDR && !fiemap)675675 goto put_out;676676677677 end_offset = ADDRS_PER_PAGE(dn.node_page, F2FS_I(inode));···708708 return err;709709}710710711711+static int get_data_block(struct inode *inode, sector_t iblock,712712+ struct buffer_head *bh_result, int create)713713+{714714+ return __get_data_block(inode, iblock, bh_result, create, false);715715+}716716+717717+static int get_data_block_fiemap(struct inode *inode, sector_t iblock,718718+ struct buffer_head *bh_result, int create)719719+{720720+ return __get_data_block(inode, iblock, bh_result, create, true);721721+}722722+711723int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,712724 u64 start, u64 len)713725{714714- return generic_block_fiemap(inode, fieinfo, start, len, get_data_block);726726+ return generic_block_fiemap(inode, fieinfo,727727+ start, len, get_data_block_fiemap);715728}716729717730static int f2fs_read_data_page(struct file *file, struct page *page)
+1-1
fs/f2fs/dir.c
···376376377377put_error:378378 f2fs_put_page(page, 1);379379+error:379380 /* once the failed inode becomes a bad inode, i_mode is S_IFREG */380381 truncate_inode_pages(&inode->i_data, 0);381382 truncate_blocks(inode, 0);382383 remove_dirty_dir_inode(inode);383383-error:384384 remove_inode_page(inode);385385 return ERR_PTR(err);386386}
+2-4
fs/f2fs/f2fs.h
···342342 struct dirty_seglist_info *dirty_info; /* dirty segment information */343343 struct curseg_info *curseg_array; /* active segment information */344344345345- struct list_head wblist_head; /* list of under-writeback pages */346346- spinlock_t wblist_lock; /* lock for checkpoint */347347-348345 block_t seg0_blkaddr; /* block address of 0'th segment */349346 block_t main_blkaddr; /* start block address of main area */350347 block_t ssa_blkaddr; /* start block address of SSA area */···641644 */642645static inline int check_nid_range(struct f2fs_sb_info *sbi, nid_t nid)643646{644644- WARN_ON((nid >= NM_I(sbi)->max_nid));647647+ if (unlikely(nid < F2FS_ROOT_INO(sbi)))648648+ return -EINVAL;645649 if (unlikely(nid >= NM_I(sbi)->max_nid))646650 return -EINVAL;647651 return 0;
···689689 struct f2fs_sb_info *sbi = F2FS_SB(sb);690690 struct inode *inode;691691692692- if (unlikely(ino < F2FS_ROOT_INO(sbi)))693693- return ERR_PTR(-ESTALE);694694- if (unlikely(ino >= NM_I(sbi)->max_nid))692692+ if (check_nid_range(sbi, ino))695693 return ERR_PTR(-ESTALE);696694697695 /*
+4-1
fs/jbd2/transaction.c
···15881588 * to perform a synchronous write. We do this to detect the15891589 * case where a single process is doing a stream of sync15901590 * writes. No point in waiting for joiners in that case.15911591+ *15921592+ * Setting max_batch_time to 0 disables this completely.15911593 */15921594 pid = current->pid;15931593- if (handle->h_sync && journal->j_last_sync_writer != pid) {15951595+ if (handle->h_sync && journal->j_last_sync_writer != pid &&15961596+ journal->j_max_batch_time) {15941597 u64 commit_time, trans_time;1595159815961599 journal->j_last_sync_writer = pid;
+30
fs/kernfs/mount.c
···211211 kernfs_put(root_kn);212212}213213214214+/**215215+ * kernfs_pin_sb: try to pin the superblock associated with a kernfs_root216216+ * @kernfs_root: the kernfs_root in question217217+ * @ns: the namespace tag218218+ *219219+ * Pin the superblock so the superblock won't be destroyed in subsequent220220+ * operations. This can be used to block ->kill_sb() which may be useful221221+ * for kernfs users which dynamically manage superblocks.222222+ *223223+ * Returns NULL if there's no superblock associated to this kernfs_root, or224224+ * -EINVAL if the superblock is being freed.225225+ */226226+struct super_block *kernfs_pin_sb(struct kernfs_root *root, const void *ns)227227+{228228+ struct kernfs_super_info *info;229229+ struct super_block *sb = NULL;230230+231231+ mutex_lock(&kernfs_mutex);232232+ list_for_each_entry(info, &root->supers, node) {233233+ if (info->ns == ns) {234234+ sb = info->sb;235235+ if (!atomic_inc_not_zero(&info->sb->s_active))236236+ sb = ERR_PTR(-EINVAL);237237+ break;238238+ }239239+ }240240+ mutex_unlock(&kernfs_mutex);241241+ return sb;242242+}243243+214244void __init kernfs_init(void)215245{216246 kernfs_node_cache = kmem_cache_create("kernfs_node_cache",
···146146 * Declaration/definition used for per-CPU variables that must be read mostly.147147 */148148#define DECLARE_PER_CPU_READ_MOSTLY(type, name) \149149- DECLARE_PER_CPU_SECTION(type, name, "..readmostly")149149+ DECLARE_PER_CPU_SECTION(type, name, "..read_mostly")150150151151#define DEFINE_PER_CPU_READ_MOSTLY(type, name) \152152- DEFINE_PER_CPU_SECTION(type, name, "..readmostly")152152+ DEFINE_PER_CPU_SECTION(type, name, "..read_mostly")153153154154/*155155 * Intermodule exports for per-CPU variables. sparse forgets about
+50-8
kernel/cgroup.c
···16481648 int flags, const char *unused_dev_name,16491649 void *data)16501650{16511651+ struct super_block *pinned_sb = NULL;16521652+ struct cgroup_subsys *ss;16511653 struct cgroup_root *root;16521654 struct cgroup_sb_opts opts;16531655 struct dentry *dentry;16541656 int ret;16571657+ int i;16551658 bool new_sb;1656165916571660 /*···16781675 cgroup_get(&root->cgrp);16791676 ret = 0;16801677 goto out_unlock;16781678+ }16791679+16801680+ /*16811681+ * Destruction of cgroup root is asynchronous, so subsystems may16821682+ * still be dying after the previous unmount. Let's drain the16831683+ * dying subsystems. We just need to ensure that the ones16841684+ * unmounted previously finish dying and don't care about new ones16851685+ * starting. Testing ref liveliness is good enough.16861686+ */16871687+ for_each_subsys(ss, i) {16881688+ if (!(opts.subsys_mask & (1 << i)) ||16891689+ ss->root == &cgrp_dfl_root)16901690+ continue;16911691+16921692+ if (!percpu_ref_tryget_live(&ss->root->cgrp.self.refcnt)) {16931693+ mutex_unlock(&cgroup_mutex);16941694+ msleep(10);16951695+ ret = restart_syscall();16961696+ goto out_free;16971697+ }16981698+ cgroup_put(&ss->root->cgrp);16811699 }1682170016831701 for_each_root(root) {···17411717 }1742171817431719 /*17441744- * A root's lifetime is governed by its root cgroup.17451745- * tryget_live failure indicate that the root is being17461746- * destroyed. Wait for destruction to complete so that the17471747- * subsystems are free. We can use wait_queue for the wait17481748- * but this path is super cold. Let's just sleep for a bit17491749- * and retry.17201720+ * We want to reuse @root whose lifetime is governed by its17211721+ * ->cgrp. Let's check whether @root is alive and keep it17221722+ * that way. As cgroup_kill_sb() can happen anytime, we17231723+ * want to block it by pinning the sb so that @root doesn't17241724+ * get killed before mount is complete.17251725+ *17261726+ * With the sb pinned, tryget_live can reliably indicate17271727+ * whether @root can be reused. If it's being killed,17281728+ * drain it. We can use wait_queue for the wait but this17291729+ * path is super cold. Let's just sleep a bit and retry.17501730 */17511751- if (!percpu_ref_tryget_live(&root->cgrp.self.refcnt)) {17311731+ pinned_sb = kernfs_pin_sb(root->kf_root, NULL);17321732+ if (IS_ERR(pinned_sb) ||17331733+ !percpu_ref_tryget_live(&root->cgrp.self.refcnt)) {17521734 mutex_unlock(&cgroup_mutex);17351735+ if (!IS_ERR_OR_NULL(pinned_sb))17361736+ deactivate_super(pinned_sb);17531737 msleep(10);17541738 ret = restart_syscall();17551739 goto out_free;···18021770 CGROUP_SUPER_MAGIC, &new_sb);18031771 if (IS_ERR(dentry) || !new_sb)18041772 cgroup_put(&root->cgrp);17731773+17741774+ /*17751775+ * If @pinned_sb, we're reusing an existing root and holding an17761776+ * extra ref on its sb. Mount is complete. Put the extra ref.17771777+ */17781778+ if (pinned_sb) {17791779+ WARN_ON(new_sb);17801780+ deactivate_super(pinned_sb);17811781+ }17821782+18051783 return dentry;18061784}18071785···3370332833713329 rcu_read_lock();33723330 css_for_each_child(child, css) {33733373- if (css->flags & CSS_ONLINE) {33313331+ if (child->flags & CSS_ONLINE) {33743332 ret = true;33753333 break;33763334 }
+19-1
kernel/cpuset.c
···1181118111821182int current_cpuset_is_being_rebound(void)11831183{11841184- return task_cs(current) == cpuset_being_rebound;11841184+ int ret;11851185+11861186+ rcu_read_lock();11871187+ ret = task_cs(current) == cpuset_being_rebound;11881188+ rcu_read_unlock();11891189+11901190+ return ret;11851191}1186119211871193static int update_relax_domain_level(struct cpuset *cs, s64 val)···16231617 * resources, wait for the previously scheduled operations before16241618 * proceeding, so that we don't end up keep removing tasks added16251619 * after execution capability is restored.16201620+ *16211621+ * cpuset_hotplug_work calls back into cgroup core via16221622+ * cgroup_transfer_tasks() and waiting for it from a cgroupfs16231623+ * operation like this one can lead to a deadlock through kernfs16241624+ * active_ref protection. Let's break the protection. Losing the16251625+ * protection is okay as we check whether @cs is online after16261626+ * grabbing cpuset_mutex anyway. This only happens on the legacy16271627+ * hierarchies.16261628 */16291629+ css_get(&cs->css);16301630+ kernfs_break_active_protection(of->kn);16271631 flush_work(&cpuset_hotplug_work);1628163216291633 mutex_lock(&cpuset_mutex);···16611645 free_trial_cpuset(trialcs);16621646out_unlock:16631647 mutex_unlock(&cpuset_mutex);16481648+ kernfs_unbreak_active_protection(of->kn);16491649+ css_put(&cs->css);16641650 return retval ?: nbytes;16651651}16661652
···142142static void prepare_logging(void)143143{144144 int i;145145+ struct stat logstat;145146146147 if (!logging)147148 return;···152151 syslog(LOG_ERR, "failed to open log file %s\n", TMON_LOG_FILE);153152 return;154153 }154154+155155+ if (lstat(TMON_LOG_FILE, &logstat) < 0) {156156+ syslog(LOG_ERR, "Unable to stat log file %s\n", TMON_LOG_FILE);157157+ fclose(tmon_log);158158+ tmon_log = NULL;159159+ return;160160+ }161161+162162+ /* The log file must be a regular file owned by us */163163+ if (S_ISLNK(logstat.st_mode)) {164164+ syslog(LOG_ERR, "Log file is a symlink. Will not log\n");165165+ fclose(tmon_log);166166+ tmon_log = NULL;167167+ return;168168+ }169169+170170+ if (logstat.st_uid != getuid()) {171171+ syslog(LOG_ERR, "We don't own the log file. Not logging\n");172172+ fclose(tmon_log);173173+ tmon_log = NULL;174174+ return;175175+ }176176+155177156178 fprintf(tmon_log, "#----------- THERMAL SYSTEM CONFIG -------------\n");157179 for (i = 0; i < ptdata.nr_tz_sensor; i++) {···355331 disable_tui();356332357333 /* change the file mode mask */358358- umask(0);334334+ umask(S_IWGRP | S_IWOTH);359335360336 /* new SID for the daemon process */361337 sid = setsid();