···11+What: /sys/class/scsi_host/hostX/isci_id22+Date: June 201133+Contact: Dave Jiang <dave.jiang@intel.com>44+Description:55+ This file contains the enumerated host ID for the Intel66+ SCU controller. The Intel(R) C600 Series Chipset SATA/SAS77+ Storage Control Unit embeds up to two 4-port controllers in88+ a single PCI device. The controllers are enumerated in order99+ which usually means the lowest number scsi_host corresponds1010+ with the first controller, but this association is not1111+ guaranteed. The 'isci_id' attribute unambiguously identifies1212+ the controller index: '0' for the first controller,1313+ '1' for the second.
+19-19
Documentation/DocBook/media/v4l/controls.xml
···14551455 </row>1456145614571457 <row><entry></entry></row>14581458- <row>14581458+ <row id="v4l2-mpeg-video-h264-vui-sar-idc">14591459 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC</constant> </entry>14601460 <entry>enum v4l2_mpeg_video_h264_vui_sar_idc</entry>14611461 </row>···15611561 </row>1562156215631563 <row><entry></entry></row>15641564- <row>15641564+ <row id="v4l2-mpeg-video-h264-level">15651565 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LEVEL</constant> </entry>15661566 <entry>enum v4l2_mpeg_video_h264_level</entry>15671567 </row>···16411641 </row>1642164216431643 <row><entry></entry></row>16441644- <row>16441644+ <row id="v4l2-mpeg-video-mpeg4-level">16451645 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL</constant> </entry>16461646 <entry>enum v4l2_mpeg_video_mpeg4_level</entry>16471647 </row>···16891689 </row>1690169016911691 <row><entry></entry></row>16921692- <row>16921692+ <row id="v4l2-mpeg-video-h264-profile">16931693 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_PROFILE</constant> </entry>16941694- <entry>enum v4l2_mpeg_h264_profile</entry>16941694+ <entry>enum v4l2_mpeg_video_h264_profile</entry>16951695 </row>16961696 <row><entry spanname="descr">The profile information for H264.16971697Applicable to the H264 encoder.···17741774 </row>1775177517761776 <row><entry></entry></row>17771777- <row>17771777+ <row id="v4l2-mpeg-video-mpeg4-profile">17781778 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE</constant> </entry>17791779- <entry>enum v4l2_mpeg_mpeg4_profile</entry>17791779+ <entry>enum v4l2_mpeg_video_mpeg4_profile</entry>17801780 </row>17811781 <row><entry spanname="descr">The profile information for MPEG4.17821782Applicable to the MPEG4 encoder.···18201820 </row>1821182118221822 <row><entry></entry></row>18231823- <row>18231823+ <row id="v4l2-mpeg-video-multi-slice-mode">18241824 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE</constant> </entry>18251825- <entry>enum v4l2_mpeg_multi_slice_mode</entry>18251825+ <entry>enum v4l2_mpeg_video_multi_slice_mode</entry>18261826 </row>18271827 <row><entry spanname="descr">Determines how the encoder should handle division of frame into slices.18281828Applicable to the encoder.···18681868 </row>1869186918701870 <row><entry></entry></row>18711871- <row>18711871+ <row id="v4l2-mpeg-video-h264-loop-filter-mode">18721872 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE</constant> </entry>18731873- <entry>enum v4l2_mpeg_h264_loop_filter_mode</entry>18731873+ <entry>enum v4l2_mpeg_video_h264_loop_filter_mode</entry>18741874 </row>18751875 <row><entry spanname="descr">Loop filter mode for H264 encoder.18761876Possible values are:</entry>···19131913 </row>1914191419151915 <row><entry></entry></row>19161916- <row>19161916+ <row id="v4l2-mpeg-video-h264-entropy-mode">19171917 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE</constant> </entry>19181918- <entry>enum v4l2_mpeg_h264_symbol_mode</entry>19181918+ <entry>enum v4l2_mpeg_video_h264_entropy_mode</entry>19191919 </row>19201920 <row><entry spanname="descr">Entropy coding mode for H264 - CABAC/CAVALC.19211921Applicable to the H264 encoder.···21402140 </row>2141214121422142 <row><entry></entry></row>21432143- <row>21432143+ <row id="v4l2-mpeg-video-header-mode">21442144 <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_HEADER_MODE</constant> </entry>21452145- <entry>enum v4l2_mpeg_header_mode</entry>21452145+ <entry>enum v4l2_mpeg_video_header_mode</entry>21462146 </row>21472147 <row><entry spanname="descr">Determines whether the header is returned as the first buffer or is21482148it returned together with the first frame. Applicable to encoders.···23202320Applicable to the H264 encoder.</entry>23212321 </row>23222322 <row><entry></entry></row>23232323- <row>23232323+ <row id="v4l2-mpeg-mfc51-video-frame-skip-mode">23242324 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE</constant> </entry>23252325- <entry>enum v4l2_mpeg_mfc51_frame_skip_mode</entry>23252325+ <entry>enum v4l2_mpeg_mfc51_video_frame_skip_mode</entry>23262326 </row>23272327 <row><entry spanname="descr">23282328Indicates in what conditions the encoder should skip frames. If encoding a frame would cause the encoded stream to be larger then···23612361</entry>23622362 </row>23632363 <row><entry></entry></row>23642364- <row>23642364+ <row id="v4l2-mpeg-mfc51-video-force-frame-type">23652365 <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE</constant> </entry>23662366- <entry>enum v4l2_mpeg_mfc51_force_frame_type</entry>23662366+ <entry>enum v4l2_mpeg_mfc51_video_force_frame_type</entry>23672367 </row>23682368 <row><entry spanname="descr">Force a frame type for the next queued buffer. Applicable to encoders.23692369Possible values are:</entry>
+1-84
Documentation/cgroups/memory.txt
···3803803813815.2 stat file382382383383-5.2.1 memory.stat file includes following statistics383383+memory.stat file includes following statistics384384385385# per-memory cgroup local status386386cache - # of bytes of page cache memory.···437437 (Note: file and shmem may be shared among other cgroups. In that case,438438 file_mapped is accounted only when the memory cgroup is owner of page439439 cache.)440440-441441-5.2.2 memory.vmscan_stat442442-443443-memory.vmscan_stat includes statistics information for memory scanning and444444-freeing, reclaiming. The statistics shows memory scanning information since445445-memory cgroup creation and can be reset to 0 by writing 0 as446446-447447- #echo 0 > ../memory.vmscan_stat448448-449449-This file contains following statistics.450450-451451-[param]_[file_or_anon]_pages_by_[reason]_[under_heararchy]452452-[param]_elapsed_ns_by_[reason]_[under_hierarchy]453453-454454-For example,455455-456456- scanned_file_pages_by_limit indicates the number of scanned457457- file pages at vmscan.458458-459459-Now, 3 parameters are supported460460-461461- scanned - the number of pages scanned by vmscan462462- rotated - the number of pages activated at vmscan463463- freed - the number of pages freed by vmscan464464-465465-If "rotated" is high against scanned/freed, the memcg seems busy.466466-467467-Now, 2 reason are supported468468-469469- limit - the memory cgroup's limit470470- system - global memory pressure + softlimit471471- (global memory pressure not under softlimit is not handled now)472472-473473-When under_hierarchy is added in the tail, the number indicates the474474-total memcg scan of its children and itself.475475-476476-elapsed_ns is a elapsed time in nanosecond. This may include sleep time477477-and not indicates CPU usage. So, please take this as just showing478478-latency.479479-480480-Here is an example.481481-482482-# cat /cgroup/memory/A/memory.vmscan_stat483483-scanned_pages_by_limit 9471864484484-scanned_anon_pages_by_limit 6640629485485-scanned_file_pages_by_limit 2831235486486-rotated_pages_by_limit 4243974487487-rotated_anon_pages_by_limit 3971968488488-rotated_file_pages_by_limit 272006489489-freed_pages_by_limit 2318492490490-freed_anon_pages_by_limit 962052491491-freed_file_pages_by_limit 1356440492492-elapsed_ns_by_limit 351386416101493493-scanned_pages_by_system 0494494-scanned_anon_pages_by_system 0495495-scanned_file_pages_by_system 0496496-rotated_pages_by_system 0497497-rotated_anon_pages_by_system 0498498-rotated_file_pages_by_system 0499499-freed_pages_by_system 0500500-freed_anon_pages_by_system 0501501-freed_file_pages_by_system 0502502-elapsed_ns_by_system 0503503-scanned_pages_by_limit_under_hierarchy 9471864504504-scanned_anon_pages_by_limit_under_hierarchy 6640629505505-scanned_file_pages_by_limit_under_hierarchy 2831235506506-rotated_pages_by_limit_under_hierarchy 4243974507507-rotated_anon_pages_by_limit_under_hierarchy 3971968508508-rotated_file_pages_by_limit_under_hierarchy 272006509509-freed_pages_by_limit_under_hierarchy 2318492510510-freed_anon_pages_by_limit_under_hierarchy 962052511511-freed_file_pages_by_limit_under_hierarchy 1356440512512-elapsed_ns_by_limit_under_hierarchy 351386416101513513-scanned_pages_by_system_under_hierarchy 0514514-scanned_anon_pages_by_system_under_hierarchy 0515515-scanned_file_pages_by_system_under_hierarchy 0516516-rotated_pages_by_system_under_hierarchy 0517517-rotated_anon_pages_by_system_under_hierarchy 0518518-rotated_file_pages_by_system_under_hierarchy 0519519-freed_pages_by_system_under_hierarchy 0520520-freed_anon_pages_by_system_under_hierarchy 0521521-freed_file_pages_by_system_under_hierarchy 0522522-elapsed_ns_by_system_under_hierarchy 05234405244415.3 swappiness525442
+8
Documentation/feature-removal-schedule.txt
···592592 interface that was used by acer-wmi driver. It will replaced by593593 information log when acer-wmi initial.594594Who: Lee, Chun-Yi <jlee@novell.com>595595+596596+----------------------------597597+What: The XFS nodelaylog mount option598598+When: 3.3599599+Why: The delaylog mode that has been the default since 2.6.39 has proven600600+ stable, and the old code is in the way of additional improvements in601601+ the log code.602602+Who: Christoph Hellwig <hch@lst.de>
+7
Documentation/hwmon/max16065
···6262the devices explicitly. Please see Documentation/i2c/instantiating-devices for6363details.64646565+WARNING: Do not access chip registers using the i2cdump command, and do not use6666+any of the i2ctools commands on a command register (0xa5 to 0xac). The chips6767+supported by this driver interpret any access to a command register (including6868+read commands) as request to execute the command in question. This may result in6969+power loss, board resets, and/or Flash corruption. Worst case, your board may7070+turn into a brick.7171+65726673Sysfs entries6774-------------
+2
Documentation/ioctl/ioctl-number.txt
···319319 <mailto:thomas@winischhofer.net>3203200xF4 00-1F video/mbxfb.h mbxfb321321 <mailto:raph@8d.com>322322+0xF6 all LTTng Linux Trace Toolkit Next Generation323323+ <mailto:mathieu.desnoyers@efficios.com>3223240xFD all linux/dm-ioctl.h
+6-3
Documentation/kernel-parameters.txt
···20862086 Override pmtimer IOPort with a hex value.20872087 e.g. pmtmr=0x5082088208820892089- pnp.debug [PNP]20902090- Enable PNP debug messages. This depends on the20912091- CONFIG_PNP_DEBUG_MESSAGES option.20892089+ pnp.debug=1 [PNP]20902090+ Enable PNP debug messages (depends on the20912091+ CONFIG_PNP_DEBUG_MESSAGES option). Change at run-time20922092+ via /sys/module/pnp/parameters/debug. We always show20932093+ current resource usage; turning this on also shows20942094+ possible settings and some assignment information.2092209520932096 pnpacpi= [ACPI]20942097 { off }
+2-1
Documentation/networking/dmfe.txt
···11+Note: This driver doesn't have a maintainer.22+13Davicom DM9102(A)/DM9132/DM9801 fast ethernet driver for Linux.2435This program is free software; you can redistribute it and/or···5755Authors:58565957Sten Wang <sten_wang@davicom.com.tw > : Original Author6060-Tobias Ringstrom <tori@unhappy.mine.nu> : Current Maintainer61586259Contributors:6360
+18-5
MAINTAINERS
···12781278ATLX ETHERNET DRIVERS12791279M: Jay Cliburn <jcliburn@gmail.com>12801280M: Chris Snook <chris.snook@gmail.com>12811281-M: Jie Yang <jie.yang@atheros.com>12821281L: netdev@vger.kernel.org12831282W: http://sourceforge.net/projects/atl112841283W: http://atl1.sourceforge.net···1573157415741575BROCADE BNA 10 GIGABIT ETHERNET DRIVER15751576M: Rasesh Mody <rmody@brocade.com>15761576-M: Debashis Dutt <ddutt@brocade.com>15771577L: netdev@vger.kernel.org15781578S: Supported15791579F: drivers/net/bna/···1756175817571759CISCO VIC ETHERNET NIC DRIVER17581760M: Christian Benvenuti <benve@cisco.com>17591759-M: Vasanthy Kolluri <vkolluri@cisco.com>17601761M: Roopa Prabhu <roprabhu@cisco.com>17611762M: David Wang <dwang2@cisco.com>17621763S: Supported···32593262F: drivers/input/input-mt.c32603263K: \b(ABS|SYN)_MT_3261326432653265+INTEL C600 SERIES SAS CONTROLLER DRIVER32663266+M: Intel SCU Linux support <intel-linux-scu@intel.com>32673267+M: Dan Williams <dan.j.williams@intel.com>32683268+M: Dave Jiang <dave.jiang@intel.com>32693269+M: Ed Nadolski <edmund.nadolski@intel.com>32703270+L: linux-scsi@vger.kernel.org32713271+T: git git://git.kernel.org/pub/scm/linux/kernel/git/djbw/isci.git32723272+S: Maintained32733273+F: drivers/scsi/isci/32743274+F: firmware/isci/32753275+32623276INTEL IDLE DRIVER32633277M: Len Brown <lenb@kernel.org>32643278L: linux-pm@lists.linux-foundation.org···44124404L: coreteam@netfilter.org44134405W: http://www.netfilter.org/44144406W: http://www.iptables.org/44154415-T: git git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6.git44074407+T: git git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-2.6.git44084408+T: git git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next-2.6.git44164409S: Supported44174410F: include/linux/netfilter*44184411F: include/linux/netfilter/···4783477447844775OSD LIBRARY and FILESYSTEM47854776M: Boaz Harrosh <bharrosh@panasas.com>47864786-M: Benny Halevy <bhalevy@panasas.com>47774777+M: Benny Halevy <bhalevy@tonian.com>47874778L: osd-dev@open-osd.org47884779W: http://open-osd.org47894780T: git git://git.open-osd.org/open-osd.git···72097200S: Supported72107201F: Documentation/hwmon/wm83??72117202F: drivers/leds/leds-wm83*.c72037203+F: drivers/input/misc/wm831x-on.c72047204+F: drivers/input/touchscreen/wm831x-ts.c72057205+F: drivers/input/touchscreen/wm97*.c72127206F: drivers/mfd/wm8*.c72137207F: drivers/power/wm83*.c72147208F: drivers/rtc/rtc-wm83*.c···72217209F: include/linux/mfd/wm831x/72227210F: include/linux/mfd/wm8350/72237211F: include/linux/mfd/wm8400*72127212+F: include/linux/wm97xx.h72247213F: include/sound/wm????.h72257214F: sound/soc/codecs/wm*72267215
···4545#define L2X0_CLEAN_INV_LINE_PA 0x7F04646#define L2X0_CLEAN_INV_LINE_IDX 0x7F84747#define L2X0_CLEAN_INV_WAY 0x7FC4848-#define L2X0_LOCKDOWN_WAY_D 0x9004949-#define L2X0_LOCKDOWN_WAY_I 0x9044848+/*4949+ * The lockdown registers repeat 8 times for L310, the L210 has only one5050+ * D and one I lockdown register at 0x0900 and 0x0904.5151+ */5252+#define L2X0_LOCKDOWN_WAY_D_BASE 0x9005353+#define L2X0_LOCKDOWN_WAY_I_BASE 0x9045454+#define L2X0_LOCKDOWN_STRIDE 0x085055#define L2X0_TEST_OPERATION 0xF005156#define L2X0_LINE_DATA 0xF105257#define L2X0_LINE_TAG 0xF30
-1
arch/arm/mach-cns3xxx/include/mach/entry-macro.S
···88 * published by the Free Software Foundation.99 */10101111-#include <mach/hardware.h>1211#include <asm/hardware/entry-macro-gic.S>13121413 .macro disable_fiq
···195195196196/**197197 * pwrdm_init - set up the powerdomain layer198198- * @pwrdm_list: array of struct powerdomain pointers to register198198+ * @pwrdms: array of struct powerdomain pointers to register199199 * @custom_funcs: func pointers for arch specific implementations200200 *201201- * Loop through the array of powerdomains @pwrdm_list, registering all202202- * that are available on the current CPU. If pwrdm_list is supplied203203- * and not null, all of the referenced powerdomains will be204204- * registered. No return value. XXX pwrdm_list is not really a205205- * "list"; it is an array. Rename appropriately.201201+ * Loop through the array of powerdomains @pwrdms, registering all202202+ * that are available on the current CPU. Also, program all203203+ * powerdomain target state as ON; this is to prevent domains from204204+ * hitting low power states (if bootloader has target states set to205205+ * something other than ON) and potentially even losing context while206206+ * PM is not fully initialized. The PM late init code can then program207207+ * the desired target state for all the power domains. No return208208+ * value.206209 */207207-void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs)210210+void pwrdm_init(struct powerdomain **pwrdms, struct pwrdm_ops *custom_funcs)208211{209212 struct powerdomain **p = NULL;213213+ struct powerdomain *temp_p;210214211215 if (!custom_funcs)212216 WARN(1, "powerdomain: No custom pwrdm functions registered\n");213217 else214218 arch_pwrdm = custom_funcs;215219216216- if (pwrdm_list) {217217- for (p = pwrdm_list; *p; p++)220220+ if (pwrdms) {221221+ for (p = pwrdms; *p; p++)218222 _pwrdm_register(*p);219223 }224224+225225+ list_for_each_entry(temp_p, &pwrdm_list, node)226226+ pwrdm_set_next_pwrst(temp_p, PWRDM_POWER_ON);220227}221228222229/**
···23232424/* This struct is saved by setup_frame in signal.c, to keep the current2525 context while a signal handler is executed. It's restored by sys_sigreturn.2626-2727- To keep things simple, we use pt_regs here even though normally you just2828- specify the list of regs to save. Then we can use copy_from_user on the2929- entire regs instead of a bunch of get_user's as well...3026*/31273228struct sigcontext {3333- struct pt_regs regs; /* needs to be first */2929+ struct user_regs_struct regs; /* needs to be first */3430 unsigned long oldmask;3535- unsigned long usp; /* usp before stacking this gunk on it */3631};37323833#endif /* __ASM_OPENRISC_SIGCONTEXT_H */
···5252static int restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc)5353{5454 unsigned int err = 0;5555- unsigned long old_usp;56555756 /* Alwys make any pending restarted system call return -EINTR */5857 current_thread_info()->restart_block.fn = do_no_restart_syscall;59586060- /* restore the regs from &sc->regs (same as sc, since regs is first)5959+ /*6060+ * Restore the regs from &sc->regs.6161 * (sc is already checked for VERIFY_READ since the sigframe was6262 * checked in sys_sigreturn previously)6363 */6464-6565- if (__copy_from_user(regs, sc, sizeof(struct pt_regs)))6464+ if (__copy_from_user(regs, sc->regs.gpr, 32 * sizeof(unsigned long)))6565+ goto badframe;6666+ if (__copy_from_user(®s->pc, &sc->regs.pc, sizeof(unsigned long)))6767+ goto badframe;6868+ if (__copy_from_user(®s->sr, &sc->regs.sr, sizeof(unsigned long)))6669 goto badframe;67706871 /* make sure the SM-bit is cleared so user-mode cannot fool us */6972 regs->sr &= ~SPR_SR_SM;7070-7171- /* restore the old USP as it was before we stacked the sc etc.7272- * (we cannot just pop the sigcontext since we aligned the sp and7373- * stuff after pushing it)7474- */7575-7676- err |= __get_user(old_usp, &sc->usp);7777-7878- regs->sp = old_usp;79738074 /* TODO: the other ports use regs->orig_XX to disable syscall checks8175 * after this completes, but we don't use that mechanism. maybe we can···131137 unsigned long mask)132138{133139 int err = 0;134134- unsigned long usp = regs->sp;135140136136- /* copy the regs. they are first in sc so we can use sc directly */141141+ /* copy the regs */137142138138- err |= __copy_to_user(sc, regs, sizeof(struct pt_regs));143143+ err |= __copy_to_user(sc->regs.gpr, regs, 32 * sizeof(unsigned long));144144+ err |= __copy_to_user(&sc->regs.pc, ®s->pc, sizeof(unsigned long));145145+ err |= __copy_to_user(&sc->regs.sr, ®s->sr, sizeof(unsigned long));139146140147 /* then some other stuff */141148142149 err |= __put_user(mask, &sc->oldmask);143143-144144- err |= __put_user(usp, &sc->usp);145150146151 return err;147152}
···171171CONFIG_CRYPTO_SHA512=y172172CONFIG_CRYPTO_AES=y173173# CONFIG_CRYPTO_ANSI_CPRNG is not set174174+CONFIG_CRYPTO_DEV_FSL_CAAM=y
+1
arch/powerpc/configs/corenet32_smp_defconfig
···185185CONFIG_CRYPTO_SHA512=y186186CONFIG_CRYPTO_AES=y187187# CONFIG_CRYPTO_ANSI_CPRNG is not set188188+CONFIG_CRYPTO_DEV_FSL_CAAM=y
+4-1
arch/powerpc/configs/corenet64_smp_defconfig
···100100CONFIG_SYSCTL_SYSCALL_CHECK=y101101CONFIG_VIRQ_DEBUG=y102102CONFIG_CRYPTO_PCBC=m103103+CONFIG_CRYPTO_SHA256=y104104+CONFIG_CRYPTO_SHA512=y105105+CONFIG_CRYPTO_AES=y103106# CONFIG_CRYPTO_ANSI_CPRNG is not set104104-CONFIG_CRYPTO_DEV_TALITOS=y107107+CONFIG_CRYPTO_DEV_FSL_CAAM=y
+1
arch/powerpc/configs/mpc85xx_defconfig
···139139CONFIG_SND_INTEL8X0=y140140# CONFIG_SND_PPC is not set141141# CONFIG_SND_USB is not set142142+CONFIG_SND_SOC=y142143CONFIG_HID_A4TECH=y143144CONFIG_HID_APPLE=y144145CONFIG_HID_BELKIN=y
+1
arch/powerpc/configs/mpc85xx_smp_defconfig
···140140CONFIG_SND_INTEL8X0=y141141# CONFIG_SND_PPC is not set142142# CONFIG_SND_USB is not set143143+CONFIG_SND_SOC=y143144CONFIG_HID_A4TECH=y144145CONFIG_HID_APPLE=y145146CONFIG_HID_BELKIN=y
···4242 unsigned long addr, unsigned long data);4343extern unsigned long getreg(struct task_struct *child, int regno);4444extern int putreg(struct task_struct *child, int regno, unsigned long value);4545-extern int get_fpregs(struct user_i387_struct __user *buf,4646- struct task_struct *child);4747-extern int set_fpregs(struct user_i387_struct __user *buf,4848- struct task_struct *child);49455046extern int arch_copy_tls(struct task_struct *new);5147extern void clear_flushed_tls(struct task_struct *task);
+1
arch/um/include/shared/line.h
···3333struct line {3434 struct tty_struct *tty;3535 spinlock_t count_lock;3636+ unsigned long count;3637 int valid;37383839 char *init_str;
+1-1
arch/um/include/shared/registers.h
···1616extern int save_registers(int pid, struct uml_pt_regs *regs);1717extern int restore_registers(int pid, struct uml_pt_regs *regs);1818extern int init_registers(int pid);1919-extern void get_safe_registers(unsigned long *regs);1919+extern void get_safe_registers(unsigned long *regs, unsigned long *fp_regs);2020extern unsigned long get_thread_reg(int reg, jmp_buf *buf);2121extern int get_fp_registers(int pid, unsigned long *regs);2222extern int put_fp_registers(int pid, unsigned long *regs);
···5050 void __user *vp = p;51515252 switch (request) {5353- /* read word at location addr. */5454- case PTRACE_PEEKTEXT:5555- case PTRACE_PEEKDATA:5656- ret = generic_ptrace_peekdata(child, addr, data);5757- break;5858-5953 /* read the word at location addr in the USER area. */6054 case PTRACE_PEEKUSR:6155 ret = peek_user(child, addr, data);6262- break;6363-6464- /* write the word at location addr. */6565- case PTRACE_POKETEXT:6666- case PTRACE_POKEDATA:6767- ret = generic_ptrace_pokedata(child, addr, data);6856 break;69577058 /* write the word at location addr in the USER area */···95107 break;96108 }97109#endif9898-#ifdef PTRACE_GETFPREGS9999- case PTRACE_GETFPREGS: /* Get the child FPU state. */100100- ret = get_fpregs(vp, child);101101- break;102102-#endif103103-#ifdef PTRACE_SETFPREGS104104- case PTRACE_SETFPREGS: /* Set the child FPU state. */105105- ret = set_fpregs(vp, child);106106- break;107107-#endif108110 case PTRACE_GET_THREAD_AREA:109111 ret = ptrace_get_thread_area(child, addr, vp);110112 break;···131153 ret = -EIO;132154 break;133155 }134134-#endif135135-#ifdef PTRACE_ARCH_PRCTL136136- case PTRACE_ARCH_PRCTL:137137- /* XXX Calls ptrace on the host - needs some SMP thinking */138138- ret = arch_prctl(child, data, (void __user *) addr);139139- break;140156#endif141157 default:142158 ret = ptrace_request(child, request, addr, data);
+8-1
arch/um/os-Linux/registers.c
···88#include <string.h>99#include <sys/ptrace.h>1010#include "sysdep/ptrace.h"1111+#include "sysdep/ptrace_user.h"1212+#include "registers.h"11131214int save_registers(int pid, struct uml_pt_regs *regs)1315{···3432/* This is set once at boot time and not changed thereafter */35333634static unsigned long exec_regs[MAX_REG_NR];3535+static unsigned long exec_fp_regs[FP_SIZE];37363837int init_registers(int pid)3938{···4542 return -errno;46434744 arch_init_registers(pid);4545+ get_fp_registers(pid, exec_fp_regs);4846 return 0;4947}50485151-void get_safe_registers(unsigned long *regs)4949+void get_safe_registers(unsigned long *regs, unsigned long *fp_regs)5250{5351 memcpy(regs, exec_regs, sizeof(exec_regs));5252+5353+ if (fp_regs)5454+ memcpy(fp_regs, exec_fp_regs, sizeof(exec_fp_regs));5455}
···373373 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp))374374 fatal_sigsegv();375375376376+ if (put_fp_registers(pid, regs->fp))377377+ fatal_sigsegv();378378+376379 /* Now we set local_using_sysemu to be used for one loop */377380 local_using_sysemu = get_using_sysemu();378381···398395 regs->is_user = 1;399396 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {400397 printk(UM_KERN_ERR "userspace - PTRACE_GETREGS failed, "398398+ "errno = %d\n", errno);399399+ fatal_sigsegv();400400+ }401401+402402+ if (get_fp_registers(pid, regs->fp)) {403403+ printk(UM_KERN_ERR "userspace - get_fp_registers failed, "401404 "errno = %d\n", errno);402405 fatal_sigsegv();403406 }···466457}467458468459static unsigned long thread_regs[MAX_REG_NR];460460+static unsigned long thread_fp_regs[FP_SIZE];469461470462static int __init init_thread_regs(void)471463{472472- get_safe_registers(thread_regs);464464+ get_safe_registers(thread_regs, thread_fp_regs);473465 /* Set parent's instruction pointer to start of clone-stub */474466 thread_regs[REGS_IP_INDEX] = STUB_CODE +475467 (unsigned long) stub_clone_handler -···510500 err = -errno;511501 printk(UM_KERN_ERR "copy_context_skas0 : PTRACE_SETREGS "512502 "failed, pid = %d, errno = %d\n", pid, -err);503503+ return err;504504+ }505505+506506+ err = put_fp_registers(pid, thread_fp_regs);507507+ if (err < 0) {508508+ printk(UM_KERN_ERR "copy_context_skas0 : put_fp_registers "509509+ "failed, pid = %d, err = %d\n", pid, err);513510 return err;514511 }515512
-5
arch/um/sys-i386/asm/ptrace.h
···4242 */4343struct user_desc;44444545-extern int get_fpxregs(struct user_fxsr_struct __user *buf,4646- struct task_struct *child);4747-extern int set_fpxregs(struct user_fxsr_struct __user *buf,4848- struct task_struct *tsk);4949-5045extern int ptrace_get_thread_area(struct task_struct *child, int idx,5146 struct user_desc __user *user_desc);5247
+23-5
arch/um/sys-i386/ptrace.c
···145145 return put_user(tmp, (unsigned long __user *) data);146146}147147148148-int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)148148+static int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)149149{150150 int err, n, cpu = ((struct thread_info *) child->stack)->cpu;151151 struct user_i387_struct fpregs;···161161 return n;162162}163163164164-int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)164164+static int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)165165{166166 int n, cpu = ((struct thread_info *) child->stack)->cpu;167167 struct user_i387_struct fpregs;···174174 (unsigned long *) &fpregs);175175}176176177177-int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)177177+static int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)178178{179179 int err, n, cpu = ((struct thread_info *) child->stack)->cpu;180180 struct user_fxsr_struct fpregs;···190190 return n;191191}192192193193-int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)193193+static int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)194194{195195 int n, cpu = ((struct thread_info *) child->stack)->cpu;196196 struct user_fxsr_struct fpregs;···206206long subarch_ptrace(struct task_struct *child, long request,207207 unsigned long addr, unsigned long data)208208{209209- return -EIO;209209+ int ret = -EIO;210210+ void __user *datap = (void __user *) data;211211+ switch (request) {212212+ case PTRACE_GETFPREGS: /* Get the child FPU state. */213213+ ret = get_fpregs(datap, child);214214+ break;215215+ case PTRACE_SETFPREGS: /* Set the child FPU state. */216216+ ret = set_fpregs(datap, child);217217+ break;218218+ case PTRACE_GETFPXREGS: /* Get the child FPU state. */219219+ ret = get_fpxregs(datap, child);220220+ break;221221+ case PTRACE_SETFPXREGS: /* Set the child FPU state. */222222+ ret = set_fpxregs(datap, child);223223+ break;224224+ default:225225+ ret = -EIO;226226+ }227227+ return ret;210228}
+1
arch/um/sys-i386/shared/sysdep/ptrace.h
···53535454struct uml_pt_regs {5555 unsigned long gp[MAX_REG_NR];5656+ unsigned long fp[HOST_FPX_SIZE];5657 struct faultinfo faultinfo;5758 long syscall;5859 int is_user;
+8-4
arch/um/sys-x86_64/ptrace.c
···145145 return instr == 0x050f;146146}147147148148-int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)148148+static int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)149149{150150 int err, n, cpu = ((struct thread_info *) child->stack)->cpu;151151 long fpregs[HOST_FP_SIZE];···162162 return n;163163}164164165165-int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)165165+static int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)166166{167167 int n, cpu = ((struct thread_info *) child->stack)->cpu;168168 long fpregs[HOST_FP_SIZE];···182182 void __user *datap = (void __user *) data;183183184184 switch (request) {185185- case PTRACE_GETFPXREGS: /* Get the child FPU state. */185185+ case PTRACE_GETFPREGS: /* Get the child FPU state. */186186 ret = get_fpregs(datap, child);187187 break;188188- case PTRACE_SETFPXREGS: /* Set the child FPU state. */188188+ case PTRACE_SETFPREGS: /* Set the child FPU state. */189189 ret = set_fpregs(datap, child);190190+ break;191191+ case PTRACE_ARCH_PRCTL:192192+ /* XXX Calls ptrace on the host - needs some SMP thinking */193193+ ret = arch_prctl(child, data, (void __user *) addr);190194 break;191195 }192196
+1
arch/um/sys-x86_64/shared/sysdep/ptrace.h
···85858686struct uml_pt_regs {8787 unsigned long gp[MAX_REG_NR];8888+ unsigned long fp[HOST_FP_SIZE];8889 struct faultinfo faultinfo;8990 long syscall;9091 int is_user;
···113113114114 /*115115 * If there's something pending, mask events again so we can116116- * jump back into xen_hypervisor_callback116116+ * jump back into xen_hypervisor_callback. Otherwise do not117117+ * touch XEN_vcpu_info_mask.117118 */118118- sete XEN_vcpu_info_mask(%eax)119119+ jne 1f120120+ movb $1, XEN_vcpu_info_mask(%eax)119121120120- popl %eax122122+1: popl %eax121123122124 /*123125 * From this point on the registers are restored and the stack
+1-1
drivers/acpi/acpica/acconfig.h
···121121122122/* Maximum sleep allowed via Sleep() operator */123123124124-#define ACPI_MAX_SLEEP 20000 /* Two seconds */124124+#define ACPI_MAX_SLEEP 2000 /* Two seconds */125125126126/******************************************************************************127127 *
···256256{257257 printk(KERN_ERR "panic occurred, switching back to text console\n");258258 return drm_fb_helper_force_kernel_mode();259259- return 0;260259}261260EXPORT_SYMBOL(drm_fb_helper_panic);262261
+2-1
drivers/gpu/drm/nouveau/nouveau_fence.c
···530530 nouveau_gpuobj_ref(NULL, &obj);531531 if (ret)532532 return ret;533533- } else {533533+ } else534534+ if (USE_SEMA(dev)) {534535 /* map fence bo into channel's vm */535536 ret = nouveau_bo_vma_add(dev_priv->fence.bo, chan->vm,536537 &chan->fence.vma);
···781781 struct drm_device *dev = crtc->dev;782782 struct drm_nouveau_private *dev_priv = dev->dev_private;783783 struct nv04_crtc_reg *regp = &dev_priv->mode_reg.crtc_reg[nv_crtc->index];784784- struct drm_framebuffer *drm_fb = nv_crtc->base.fb;785785- struct nouveau_framebuffer *fb = nouveau_framebuffer(drm_fb);784784+ struct drm_framebuffer *drm_fb;785785+ struct nouveau_framebuffer *fb;786786 int arb_burst, arb_lwm;787787 int ret;788788+789789+ NV_DEBUG_KMS(dev, "index %d\n", nv_crtc->index);790790+791791+ /* no fb bound */792792+ if (!atomic && !crtc->fb) {793793+ NV_DEBUG_KMS(dev, "No FB bound\n");794794+ return 0;795795+ }796796+788797789798 /* If atomic, we want to switch to the fb we were passed, so790799 * now we update pointers to do that. (We don't pin; just···803794 drm_fb = passed_fb;804795 fb = nouveau_framebuffer(passed_fb);805796 } else {797797+ drm_fb = crtc->fb;798798+ fb = nouveau_framebuffer(crtc->fb);806799 /* If not atomic, we can go ahead and pin, and unpin the807800 * old fb we were passed.808801 */
+10-2
drivers/gpu/drm/nouveau/nv50_crtc.c
···519519 struct drm_device *dev = nv_crtc->base.dev;520520 struct drm_nouveau_private *dev_priv = dev->dev_private;521521 struct nouveau_channel *evo = nv50_display(dev)->master;522522- struct drm_framebuffer *drm_fb = nv_crtc->base.fb;523523- struct nouveau_framebuffer *fb = nouveau_framebuffer(drm_fb);522522+ struct drm_framebuffer *drm_fb;523523+ struct nouveau_framebuffer *fb;524524 int ret;525525526526 NV_DEBUG_KMS(dev, "index %d\n", nv_crtc->index);527527+528528+ /* no fb bound */529529+ if (!atomic && !crtc->fb) {530530+ NV_DEBUG_KMS(dev, "No FB bound\n");531531+ return 0;532532+ }527533528534 /* If atomic, we want to switch to the fb we were passed, so529535 * now we update pointers to do that. (We don't pin; just···539533 drm_fb = passed_fb;540534 fb = nouveau_framebuffer(passed_fb);541535 } else {536536+ drm_fb = crtc->fb;537537+ fb = nouveau_framebuffer(crtc->fb);542538 /* If not atomic, we can go ahead and pin, and unpin the543539 * old fb we were passed.544540 */
+35-6
drivers/gpu/drm/radeon/evergreen.c
···4141void evergreen_fini(struct radeon_device *rdev);4242static void evergreen_pcie_gen2_enable(struct radeon_device *rdev);43434444+void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev)4545+{4646+ u16 ctl, v;4747+ int cap, err;4848+4949+ cap = pci_pcie_cap(rdev->pdev);5050+ if (!cap)5151+ return;5252+5353+ err = pci_read_config_word(rdev->pdev, cap + PCI_EXP_DEVCTL, &ctl);5454+ if (err)5555+ return;5656+5757+ v = (ctl & PCI_EXP_DEVCTL_READRQ) >> 12;5858+5959+ /* if bios or OS sets MAX_READ_REQUEST_SIZE to an invalid value, fix it6060+ * to avoid hangs or perfomance issues6161+ */6262+ if ((v == 0) || (v == 6) || (v == 7)) {6363+ ctl &= ~PCI_EXP_DEVCTL_READRQ;6464+ ctl |= (2 << 12);6565+ pci_write_config_word(rdev->pdev, cap + PCI_EXP_DEVCTL, ctl);6666+ }6767+}6868+4469void evergreen_pre_page_flip(struct radeon_device *rdev, int crtc)4570{4671 /* enable the pflip int */···14041379 /* Initialize the ring buffer's read and write pointers */14051380 WREG32(CP_RB_CNTL, tmp | RB_RPTR_WR_ENA);14061381 WREG32(CP_RB_RPTR_WR, 0);14071407- WREG32(CP_RB_WPTR, 0);13821382+ rdev->cp.wptr = 0;13831383+ WREG32(CP_RB_WPTR, rdev->cp.wptr);1408138414091385 /* set the wb address wether it's enabled or not */14101386 WREG32(CP_RB_RPTR_ADDR,···14271401 WREG32(CP_DEBUG, (1 << 27) | (1 << 28));1428140214291403 rdev->cp.rptr = RREG32(CP_RB_RPTR);14301430- rdev->cp.wptr = RREG32(CP_RB_WPTR);1431140414321405 evergreen_cp_start(rdev);14331406 rdev->cp.ready = true;···18871862 }1888186318891864 WREG32(GRBM_CNTL, GRBM_READ_TIMEOUT(0xff));18651865+18661866+ evergreen_fix_pci_max_read_req_size(rdev);1890186718911868 cc_gc_shader_pipe_config = RREG32(CC_GC_SHADER_PIPE_CONFIG) & ~2;18921869···31713144}3172314531733146int evergreen_copy_blit(struct radeon_device *rdev,31743174- uint64_t src_offset, uint64_t dst_offset,31753175- unsigned num_pages, struct radeon_fence *fence)31473147+ uint64_t src_offset,31483148+ uint64_t dst_offset,31493149+ unsigned num_gpu_pages,31503150+ struct radeon_fence *fence)31763151{31773152 int r;3178315331793154 mutex_lock(&rdev->r600_blit.mutex);31803155 rdev->r600_blit.vb_ib = NULL;31813181- r = evergreen_blit_prepare_copy(rdev, num_pages * RADEON_GPU_PAGE_SIZE);31563156+ r = evergreen_blit_prepare_copy(rdev, num_gpu_pages * RADEON_GPU_PAGE_SIZE);31823157 if (r) {31833158 if (rdev->r600_blit.vb_ib)31843159 radeon_ib_free(rdev, &rdev->r600_blit.vb_ib);31853160 mutex_unlock(&rdev->r600_blit.mutex);31863161 return r;31873162 }31883188- evergreen_kms_blit_copy(rdev, src_offset, dst_offset, num_pages * RADEON_GPU_PAGE_SIZE);31633163+ evergreen_kms_blit_copy(rdev, src_offset, dst_offset, num_gpu_pages * RADEON_GPU_PAGE_SIZE);31893164 evergreen_blit_done_copy(rdev, fence);31903165 mutex_unlock(&rdev->r600_blit.mutex);31913166 return 0;
+9-6
drivers/gpu/drm/radeon/ni.c
···3939extern void evergreen_mc_program(struct radeon_device *rdev);4040extern void evergreen_irq_suspend(struct radeon_device *rdev);4141extern int evergreen_mc_init(struct radeon_device *rdev);4242+extern void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev);42434344#define EVERGREEN_PFP_UCODE_SIZE 11204445#define EVERGREEN_PM4_UCODE_SIZE 1376···670669671670 WREG32(GRBM_CNTL, GRBM_READ_TIMEOUT(0xff));672671672672+ evergreen_fix_pci_max_read_req_size(rdev);673673+673674 mc_shared_chmap = RREG32(MC_SHARED_CHMAP);674675 mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG);675676···1187118411881185 /* Initialize the ring buffer's read and write pointers */11891186 WREG32(CP_RB0_CNTL, tmp | RB_RPTR_WR_ENA);11901190- WREG32(CP_RB0_WPTR, 0);11871187+ rdev->cp.wptr = 0;11881188+ WREG32(CP_RB0_WPTR, rdev->cp.wptr);1191118911921190 /* set the wb address wether it's enabled or not */11931191 WREG32(CP_RB0_RPTR_ADDR, (rdev->wb.gpu_addr + RADEON_WB_CP_RPTR_OFFSET) & 0xFFFFFFFC);···12081204 WREG32(CP_RB0_BASE, rdev->cp.gpu_addr >> 8);1209120512101206 rdev->cp.rptr = RREG32(CP_RB0_RPTR);12111211- rdev->cp.wptr = RREG32(CP_RB0_WPTR);1212120712131208 /* ring1 - compute only */12141209 /* Set ring buffer size */···1220121712211218 /* Initialize the ring buffer's read and write pointers */12221219 WREG32(CP_RB1_CNTL, tmp | RB_RPTR_WR_ENA);12231223- WREG32(CP_RB1_WPTR, 0);12201220+ rdev->cp1.wptr = 0;12211221+ WREG32(CP_RB1_WPTR, rdev->cp1.wptr);1224122212251223 /* set the wb address wether it's enabled or not */12261224 WREG32(CP_RB1_RPTR_ADDR, (rdev->wb.gpu_addr + RADEON_WB_CP1_RPTR_OFFSET) & 0xFFFFFFFC);···12331229 WREG32(CP_RB1_BASE, rdev->cp1.gpu_addr >> 8);1234123012351231 rdev->cp1.rptr = RREG32(CP_RB1_RPTR);12361236- rdev->cp1.wptr = RREG32(CP_RB1_WPTR);1237123212381233 /* ring2 - compute only */12391234 /* Set ring buffer size */···1245124212461243 /* Initialize the ring buffer's read and write pointers */12471244 WREG32(CP_RB2_CNTL, tmp | RB_RPTR_WR_ENA);12481248- WREG32(CP_RB2_WPTR, 0);12451245+ rdev->cp2.wptr = 0;12461246+ WREG32(CP_RB2_WPTR, rdev->cp2.wptr);1249124712501248 /* set the wb address wether it's enabled or not */12511249 WREG32(CP_RB2_RPTR_ADDR, (rdev->wb.gpu_addr + RADEON_WB_CP2_RPTR_OFFSET) & 0xFFFFFFFC);···12581254 WREG32(CP_RB2_BASE, rdev->cp2.gpu_addr >> 8);1259125512601256 rdev->cp2.rptr = RREG32(CP_RB2_RPTR);12611261- rdev->cp2.wptr = RREG32(CP_RB2_WPTR);1262125712631258 /* start the rings */12641259 cayman_cp_start(rdev);
+10-12
drivers/gpu/drm/radeon/r100.c
···721721int r100_copy_blit(struct radeon_device *rdev,722722 uint64_t src_offset,723723 uint64_t dst_offset,724724- unsigned num_pages,724724+ unsigned num_gpu_pages,725725 struct radeon_fence *fence)726726{727727 uint32_t cur_pages;728728- uint32_t stride_bytes = PAGE_SIZE;728728+ uint32_t stride_bytes = RADEON_GPU_PAGE_SIZE;729729 uint32_t pitch;730730 uint32_t stride_pixels;731731 unsigned ndw;···737737 /* radeon pitch is /64 */738738 pitch = stride_bytes / 64;739739 stride_pixels = stride_bytes / 4;740740- num_loops = DIV_ROUND_UP(num_pages, 8191);740740+ num_loops = DIV_ROUND_UP(num_gpu_pages, 8191);741741742742 /* Ask for enough room for blit + flush + fence */743743 ndw = 64 + (10 * num_loops);···746746 DRM_ERROR("radeon: moving bo (%d) asking for %u dw.\n", r, ndw);747747 return -EINVAL;748748 }749749- while (num_pages > 0) {750750- cur_pages = num_pages;749749+ while (num_gpu_pages > 0) {750750+ cur_pages = num_gpu_pages;751751 if (cur_pages > 8191) {752752 cur_pages = 8191;753753 }754754- num_pages -= cur_pages;754754+ num_gpu_pages -= cur_pages;755755756756 /* pages are in Y direction - height757757 page width in X direction - width */···773773 radeon_ring_write(rdev, (0x1fff) | (0x1fff << 16));774774 radeon_ring_write(rdev, 0);775775 radeon_ring_write(rdev, (0x1fff) | (0x1fff << 16));776776- radeon_ring_write(rdev, num_pages);777777- radeon_ring_write(rdev, num_pages);776776+ radeon_ring_write(rdev, cur_pages);777777+ radeon_ring_write(rdev, cur_pages);778778 radeon_ring_write(rdev, cur_pages | (stride_pixels << 16));779779 }780780 radeon_ring_write(rdev, PACKET0(RADEON_DSTCACHE_CTLSTAT, 0));···990990 /* Force read & write ptr to 0 */991991 WREG32(RADEON_CP_RB_CNTL, tmp | RADEON_RB_RPTR_WR_ENA | RADEON_RB_NO_UPDATE);992992 WREG32(RADEON_CP_RB_RPTR_WR, 0);993993- WREG32(RADEON_CP_RB_WPTR, 0);993993+ rdev->cp.wptr = 0;994994+ WREG32(RADEON_CP_RB_WPTR, rdev->cp.wptr);994995995996 /* set the wb address whether it's enabled or not */996997 WREG32(R_00070C_CP_RB_RPTR_ADDR,···10081007 WREG32(RADEON_CP_RB_CNTL, tmp);10091008 udelay(10);10101009 rdev->cp.rptr = RREG32(RADEON_CP_RB_RPTR);10111011- rdev->cp.wptr = RREG32(RADEON_CP_RB_WPTR);10121012- /* protect against crazy HW on resume */10131013- rdev->cp.wptr &= rdev->cp.ptr_mask;10141010 /* Set cp mode to bus mastering & enable cp*/10151011 WREG32(RADEON_CP_CSQ_MODE,10161012 REG_SET(RADEON_INDIRECT2_START, indirect2_start) |
···219219 } else {220220 DRM_INFO("Using generic clock info\n");221221222222+ /* may need to be per card */223223+ rdev->clock.max_pixel_clock = 35000;224224+222225 if (rdev->flags & RADEON_IS_IGP) {223226 p1pll->reference_freq = 1432;224227 p2pll->reference_freq = 1432;
+24-13
drivers/gpu/drm/radeon/radeon_connectors.c
···12971297 if (!radeon_dig_connector->edp_on)12981298 atombios_set_edp_panel_power(connector,12991299 ATOM_TRANSMITTER_ACTION_POWER_OFF);13001300- } else {13011301- /* need to setup ddc on the bridge */13021302- if (radeon_connector_encoder_is_dp_bridge(connector)) {13001300+ } else if (radeon_connector_encoder_is_dp_bridge(connector)) {13011301+ /* DP bridges are always DP */13021302+ radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT;13031303+ /* get the DPCD from the bridge */13041304+ radeon_dp_getdpcd(radeon_connector);13051305+13061306+ if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd))13071307+ ret = connector_status_connected;13081308+ else {13091309+ /* need to setup ddc on the bridge */13031310 if (encoder)13041311 radeon_atom_ext_encoder_setup_ddc(encoder);13121312+ if (radeon_ddc_probe(radeon_connector,13131313+ radeon_connector->requires_extended_probe))13141314+ ret = connector_status_connected;13051315 }13161316+13171317+ if ((ret == connector_status_disconnected) &&13181318+ radeon_connector->dac_load_detect) {13191319+ struct drm_encoder *encoder = radeon_best_single_encoder(connector);13201320+ struct drm_encoder_helper_funcs *encoder_funcs;13211321+ if (encoder) {13221322+ encoder_funcs = encoder->helper_private;13231323+ ret = encoder_funcs->detect(encoder, connector);13241324+ }13251325+ }13261326+ } else {13061327 radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector);13071328 if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) {13081329 ret = connector_status_connected;···13371316 if (radeon_ddc_probe(radeon_connector,13381317 radeon_connector->requires_extended_probe))13391318 ret = connector_status_connected;13401340- }13411341- }13421342-13431343- if ((ret == connector_status_disconnected) &&13441344- radeon_connector->dac_load_detect) {13451345- struct drm_encoder *encoder = radeon_best_single_encoder(connector);13461346- struct drm_encoder_helper_funcs *encoder_funcs;13471347- if (encoder) {13481348- encoder_funcs = encoder->helper_private;13491349- ret = encoder_funcs->detect(encoder, connector);13501319 }13511320 }13521321 }
···394394395395 if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) {396396 if (bo->ttm == NULL) {397397- ret = ttm_bo_add_ttm(bo, false);397397+ bool zero = !(old_man->flags & TTM_MEMTYPE_FLAG_FIXED);398398+ ret = ttm_bo_add_ttm(bo, zero);398399 if (ret)399400 goto out_err;400401 }
···8181#define NO_TOUCHES -18282#define SINGLE_TOUCH_UP -283838484+/* Touch surface information. Dimension is in hundredths of a mm, min and max8585+ * are in units. */8686+#define MOUSE_DIMENSION_X (float)90568787+#define MOUSE_MIN_X -11008888+#define MOUSE_MAX_X 12588989+#define MOUSE_RES_X ((MOUSE_MAX_X - MOUSE_MIN_X) / (MOUSE_DIMENSION_X / 100))9090+#define MOUSE_DIMENSION_Y (float)51529191+#define MOUSE_MIN_Y -15899292+#define MOUSE_MAX_Y 20479393+#define MOUSE_RES_Y ((MOUSE_MAX_Y - MOUSE_MIN_Y) / (MOUSE_DIMENSION_Y / 100))9494+9595+#define TRACKPAD_DIMENSION_X (float)130009696+#define TRACKPAD_MIN_X -29099797+#define TRACKPAD_MAX_X 31679898+#define TRACKPAD_RES_X \9999+ ((TRACKPAD_MAX_X - TRACKPAD_MIN_X) / (TRACKPAD_DIMENSION_X / 100))100100+#define TRACKPAD_DIMENSION_Y (float)11000101101+#define TRACKPAD_MIN_Y -2456102102+#define TRACKPAD_MAX_Y 2565103103+#define TRACKPAD_RES_Y \104104+ ((TRACKPAD_MAX_Y - TRACKPAD_MIN_Y) / (TRACKPAD_DIMENSION_Y / 100))105105+84106/**85107 * struct magicmouse_sc - Tracks Magic Mouse-specific data.86108 * @input: Input device through which we report events.···428406 * inverse of the reported Y.429407 */430408 if (input->id.product == USB_DEVICE_ID_APPLE_MAGICMOUSE) {431431- input_set_abs_params(input, ABS_MT_POSITION_X, -1100,432432- 1358, 4, 0);433433- input_set_abs_params(input, ABS_MT_POSITION_Y, -1589,434434- 2047, 4, 0);409409+ input_set_abs_params(input, ABS_MT_POSITION_X,410410+ MOUSE_MIN_X, MOUSE_MAX_X, 4, 0);411411+ input_set_abs_params(input, ABS_MT_POSITION_Y,412412+ MOUSE_MIN_Y, MOUSE_MAX_Y, 4, 0);413413+414414+ input_abs_set_res(input, ABS_MT_POSITION_X,415415+ MOUSE_RES_X);416416+ input_abs_set_res(input, ABS_MT_POSITION_Y,417417+ MOUSE_RES_Y);435418 } else { /* USB_DEVICE_ID_APPLE_MAGICTRACKPAD */436436- input_set_abs_params(input, ABS_X, -2909, 3167, 4, 0);437437- input_set_abs_params(input, ABS_Y, -2456, 2565, 4, 0);438438- input_set_abs_params(input, ABS_MT_POSITION_X, -2909,439439- 3167, 4, 0);440440- input_set_abs_params(input, ABS_MT_POSITION_Y, -2456,441441- 2565, 4, 0);419419+ input_set_abs_params(input, ABS_X, TRACKPAD_MIN_X,420420+ TRACKPAD_MAX_X, 4, 0);421421+ input_set_abs_params(input, ABS_Y, TRACKPAD_MIN_Y,422422+ TRACKPAD_MAX_Y, 4, 0);423423+ input_set_abs_params(input, ABS_MT_POSITION_X,424424+ TRACKPAD_MIN_X, TRACKPAD_MAX_X, 4, 0);425425+ input_set_abs_params(input, ABS_MT_POSITION_Y,426426+ TRACKPAD_MIN_Y, TRACKPAD_MAX_Y, 4, 0);427427+428428+ input_abs_set_res(input, ABS_X, TRACKPAD_RES_X);429429+ input_abs_set_res(input, ABS_Y, TRACKPAD_RES_Y);430430+ input_abs_set_res(input, ABS_MT_POSITION_X,431431+ TRACKPAD_RES_X);432432+ input_abs_set_res(input, ABS_MT_POSITION_Y,433433+ TRACKPAD_RES_Y);442434 }443435444436 input_set_events_per_packet(input, 60);···537501 }538502 report->size = 6;539503504504+ /*505505+ * Some devices repond with 'invalid report id' when feature506506+ * report switching it into multitouch mode is sent to it.507507+ *508508+ * This results in -EIO from the _raw low-level transport callback,509509+ * but there seems to be no other way of switching the mode.510510+ * Thus the super-ugly hacky success check below.511511+ */540512 ret = hdev->hid_output_raw_report(hdev, feature, sizeof(feature),541513 HID_FEATURE_REPORT);542542- if (ret != sizeof(feature)) {514514+ if (ret != -EIO && ret != sizeof(feature)) {543515 hid_err(hdev, "unable to request touch data (%d)\n", ret);544516 goto err_stop_hw;545517 }
+12-12
drivers/hid/hid-wacom.c
···353353 if (ret) {354354 hid_warn(hdev, "can't create sysfs battery attribute, err: %d\n",355355 ret);356356- /*357357- * battery attribute is not critical for the tablet, but if it358358- * failed then there is no need to create ac attribute359359- */360360- goto move_on;356356+ goto err_battery;361357 }362358363359 wdata->ac.properties = wacom_ac_props;···367371 if (ret) {368372 hid_warn(hdev,369373 "can't create ac battery attribute, err: %d\n", ret);370370- /*371371- * ac attribute is not critical for the tablet, but if it372372- * failed then we don't want to battery attribute to exist373373- */374374- power_supply_unregister(&wdata->battery);374374+ goto err_ac;375375 }376376-377377-move_on:378376#endif379377 hidinput = list_entry(hdev->inputs.next, struct hid_input, list);380378 input = hidinput->input;379379+380380+ __set_bit(INPUT_PROP_POINTER, input->propbit);381381382382 /* Basics */383383 input->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_REL);···408416409417 return 0;410418419419+#ifdef CONFIG_HID_WACOM_POWER_SUPPLY420420+err_ac:421421+ power_supply_unregister(&wdata->battery);422422+err_battery:423423+ device_remove_file(&hdev->dev, &dev_attr_speed);424424+ hid_hw_stop(hdev);425425+#endif411426err_free:412427 kfree(wdata);413428 return ret;···425426#ifdef CONFIG_HID_WACOM_POWER_SUPPLY426427 struct wacom_data *wdata = hid_get_drvdata(hdev);427428#endif429429+ device_remove_file(&hdev->dev, &dev_attr_speed);428430 hid_hw_stop(hdev);429431430432#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
···141141 block_buffer[ret] = '\0';142142 dev_info(&client->dev, "Device ID %s\n", block_buffer);143143144144- mid = NULL;145145- for (i = 0; i < ARRAY_SIZE(ucd9000_id); i++) {146146- mid = &ucd9000_id[i];144144+ for (mid = ucd9000_id; mid->name[0]; mid++) {147145 if (!strncasecmp(mid->name, block_buffer, strlen(mid->name)))148146 break;149147 }150150- if (!mid || !strlen(mid->name)) {148148+ if (!mid->name[0]) {151149 dev_err(&client->dev, "Unsupported device\n");152150 return -ENODEV;153151 }
+2-4
drivers/hwmon/pmbus/ucd9200.c
···6868 block_buffer[ret] = '\0';6969 dev_info(&client->dev, "Device ID %s\n", block_buffer);70707171- mid = NULL;7272- for (i = 0; i < ARRAY_SIZE(ucd9200_id); i++) {7373- mid = &ucd9200_id[i];7171+ for (mid = ucd9200_id; mid->name[0]; mid++) {7472 if (!strncasecmp(mid->name, block_buffer, strlen(mid->name)))7573 break;7674 }7777- if (!mid || !strlen(mid->name)) {7575+ if (!mid->name[0]) {7876 dev_err(&client->dev, "Unsupported device\n");7977 return -ENODEV;8078 }
+4-1
drivers/i2c/busses/i2c-pxa-pci.c
···109109 return -EINVAL;110110 }111111 sds = kzalloc(sizeof(*sds), GFP_KERNEL);112112- if (!sds)112112+ if (!sds) {113113+ ret = -ENOMEM;113114 goto err_mem;115115+ }114116115117 for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) {116118 sds->pdev[i] = add_i2c_device(dev, i);117119 if (IS_ERR(sds->pdev[i])) {120120+ ret = PTR_ERR(sds->pdev[i]);118121 while (--i >= 0)119122 platform_device_unregister(sds->pdev[i]);120123 goto err_dev_add;
+44-14
drivers/i2c/busses/i2c-tegra.c
···270270271271 /* Rounds down to not include partial word at the end of buf */272272 words_to_transfer = buf_remaining / BYTES_PER_FIFO_WORD;273273- if (words_to_transfer > tx_fifo_avail)274274- words_to_transfer = tx_fifo_avail;275273276276- i2c_writesl(i2c_dev, buf, I2C_TX_FIFO, words_to_transfer);274274+ /* It's very common to have < 4 bytes, so optimize that case. */275275+ if (words_to_transfer) {276276+ if (words_to_transfer > tx_fifo_avail)277277+ words_to_transfer = tx_fifo_avail;277278278278- buf += words_to_transfer * BYTES_PER_FIFO_WORD;279279- buf_remaining -= words_to_transfer * BYTES_PER_FIFO_WORD;280280- tx_fifo_avail -= words_to_transfer;279279+ /*280280+ * Update state before writing to FIFO. If this casues us281281+ * to finish writing all bytes (AKA buf_remaining goes to 0) we282282+ * have a potential for an interrupt (PACKET_XFER_COMPLETE is283283+ * not maskable). We need to make sure that the isr sees284284+ * buf_remaining as 0 and doesn't call us back re-entrantly.285285+ */286286+ buf_remaining -= words_to_transfer * BYTES_PER_FIFO_WORD;287287+ tx_fifo_avail -= words_to_transfer;288288+ i2c_dev->msg_buf_remaining = buf_remaining;289289+ i2c_dev->msg_buf = buf +290290+ words_to_transfer * BYTES_PER_FIFO_WORD;291291+ barrier();292292+293293+ i2c_writesl(i2c_dev, buf, I2C_TX_FIFO, words_to_transfer);294294+295295+ buf += words_to_transfer * BYTES_PER_FIFO_WORD;296296+ }281297282298 /*283299 * If there is a partial word at the end of buf, handle it manually to···303287 if (tx_fifo_avail > 0 && buf_remaining > 0) {304288 BUG_ON(buf_remaining > 3);305289 memcpy(&val, buf, buf_remaining);290290+291291+ /* Again update before writing to FIFO to make sure isr sees. */292292+ i2c_dev->msg_buf_remaining = 0;293293+ i2c_dev->msg_buf = NULL;294294+ barrier();295295+306296 i2c_writel(i2c_dev, val, I2C_TX_FIFO);307307- buf_remaining = 0;308308- tx_fifo_avail--;309297 }310298311311- BUG_ON(tx_fifo_avail > 0 && buf_remaining > 0);312312- i2c_dev->msg_buf_remaining = buf_remaining;313313- i2c_dev->msg_buf = buf;314299 return 0;315300}316301···428411 tegra_i2c_mask_irq(i2c_dev, I2C_INT_TX_FIFO_DATA_REQ);429412 }430413431431- if ((status & I2C_INT_PACKET_XFER_COMPLETE) &&432432- !i2c_dev->msg_buf_remaining)414414+ if (status & I2C_INT_PACKET_XFER_COMPLETE) {415415+ BUG_ON(i2c_dev->msg_buf_remaining);433416 complete(&i2c_dev->msg_complete);417417+ }434418435419 i2c_writel(i2c_dev, status, I2C_INT_STATUS);436420 if (i2c_dev->is_dvc)···549531550532static u32 tegra_i2c_func(struct i2c_adapter *adap)551533{552552- return I2C_FUNC_I2C;534534+ return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;553535}554536555537static const struct i2c_algorithm tegra_i2c_algo = {···737719}738720#endif739721722722+#if defined(CONFIG_OF)723723+/* Match table for of_platform binding */724724+static const struct of_device_id tegra_i2c_of_match[] __devinitconst = {725725+ { .compatible = "nvidia,tegra20-i2c", },726726+ {},727727+};728728+MODULE_DEVICE_TABLE(of, tegra_i2c_of_match);729729+#else730730+#define tegra_i2c_of_match NULL731731+#endif732732+740733static struct platform_driver tegra_i2c_driver = {741734 .probe = tegra_i2c_probe,742735 .remove = tegra_i2c_remove,···758729 .driver = {759730 .name = "tegra-i2c",760731 .owner = THIS_MODULE,732732+ .of_match_table = tegra_i2c_of_match,761733 },762734};763735
···605605 * Writes the command to the IOMMUs command buffer and informs the606606 * hardware about the new command.607607 */608608-static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd)608608+static int iommu_queue_command_sync(struct amd_iommu *iommu,609609+ struct iommu_cmd *cmd,610610+ bool sync)609611{610612 u32 left, tail, head, next_tail;611613 unsigned long flags;···641639 copy_cmd_to_buffer(iommu, cmd, tail);642640643641 /* We need to sync now to make sure all commands are processed */644644- iommu->need_sync = true;642642+ iommu->need_sync = sync;645643646644 spin_unlock_irqrestore(&iommu->lock, flags);647645648646 return 0;647647+}648648+649649+static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd)650650+{651651+ return iommu_queue_command_sync(iommu, cmd, true);649652}650653651654/*···668661669662 build_completion_wait(&cmd, (u64)&sem);670663671671- ret = iommu_queue_command(iommu, &cmd);664664+ ret = iommu_queue_command_sync(iommu, &cmd, false);672665 if (ret)673666 return ret;674667···847840static void domain_flush_devices(struct protection_domain *domain)848841{849842 struct iommu_dev_data *dev_data;850850- unsigned long flags;851851-852852- spin_lock_irqsave(&domain->lock, flags);853843854844 list_for_each_entry(dev_data, &domain->dev_list, list)855845 device_flush_dte(dev_data);856856-857857- spin_unlock_irqrestore(&domain->lock, flags);858846}859847860848/****************************************************************************
+1-1
drivers/iommu/dmar.c
···13881388 return ret;13891389 }1390139013911391- ret = request_irq(irq, dmar_fault, 0, iommu->name, iommu);13911391+ ret = request_irq(irq, dmar_fault, IRQF_NO_THREAD, iommu->name, iommu);13921392 if (ret)13931393 printk(KERN_ERR "IOMMU: can't request irq\n");13941394 return ret;
+2
drivers/leds/ledtrig-timer.c
···41414242 if (count == size) {4343 led_blink_set(led_cdev, &state, &led_cdev->blink_delay_off);4444+ led_cdev->blink_delay_on = state;4445 ret = count;4546 }4647···70697170 if (count == size) {7271 led_blink_set(led_cdev, &led_cdev->blink_delay_on, &state);7272+ led_cdev->blink_delay_off = state;7373 ret = count;7474 }7575
···848848 bio->bi_end_io = super_written;849849850850 atomic_inc(&mddev->pending_writes);851851- submit_bio(REQ_WRITE | REQ_SYNC | REQ_FLUSH | REQ_FUA, bio);851851+ submit_bio(WRITE_FLUSH_FUA, bio);852852}853853854854void md_super_wait(mddev_t *mddev)···11381138 ret = 0;11391139 }11401140 rdev->sectors = rdev->sb_start;11411141+ /* Limit to 4TB as metadata cannot record more than that */11421142+ if (rdev->sectors >= (2ULL << 32))11431143+ rdev->sectors = (2ULL << 32) - 2;1141114411421142- if (rdev->sectors < sb->size * 2 && sb->level > 1)11451145+ if (rdev->sectors < ((sector_t)sb->size) * 2 && sb->level >= 1)11431146 /* "this cannot possibly happen" ... */11441147 ret = -EINVAL;11451148···11761173 mddev->clevel[0] = 0;11771174 mddev->layout = sb->layout;11781175 mddev->raid_disks = sb->raid_disks;11791179- mddev->dev_sectors = sb->size * 2;11761176+ mddev->dev_sectors = ((sector_t)sb->size) * 2;11801177 mddev->events = ev1;11811178 mddev->bitmap_info.offset = 0;11821179 mddev->bitmap_info.default_offset = MD_SB_BYTES >> 9;···14181415 rdev->sb_start = calc_dev_sboffset(rdev);14191416 if (!num_sectors || num_sectors > rdev->sb_start)14201417 num_sectors = rdev->sb_start;14181418+ /* Limit to 4TB as metadata cannot record more than that.14191419+ * 4TB == 2^32 KB, or 2*2^32 sectors.14201420+ */14211421+ if (num_sectors >= (2ULL << 32))14221422+ num_sectors = (2ULL << 32) - 2;14211423 md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size,14221424 rdev->sb_page);14231425 md_super_wait(rdev->mddev);···17451737 sb->chunksize = cpu_to_le32(mddev->chunk_sectors);17461738 sb->level = cpu_to_le32(mddev->level);17471739 sb->layout = cpu_to_le32(mddev->layout);17401740+17411741+ if (test_bit(WriteMostly, &rdev->flags))17421742+ sb->devflags |= WriteMostly1;17431743+ else17441744+ sb->devflags &= ~WriteMostly1;1748174517491746 if (mddev->bitmap && mddev->bitmap_info.file == NULL) {17501747 sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_info.offset);···25742561 int err = -EINVAL;25752562 if (cmd_match(buf, "faulty") && rdev->mddev->pers) {25762563 md_error(rdev->mddev, rdev);25772577- err = 0;25642564+ if (test_bit(Faulty, &rdev->flags))25652565+ err = 0;25662566+ else25672567+ err = -EBUSY;25782568 } else if (cmd_match(buf, "remove")) {25792569 if (rdev->raid_disk >= 0)25802570 err = -EBUSY;···26002584 err = 0;26012585 } else if (cmd_match(buf, "-blocked")) {26022586 if (!test_bit(Faulty, &rdev->flags) &&26032603- test_bit(BlockedBadBlocks, &rdev->flags)) {25872587+ rdev->badblocks.unacked_exist) {26042588 /* metadata handler doesn't understand badblocks,26052589 * so we need to fail the device26062590 */···59995983 return -ENODEV;6000598460015985 md_error(mddev, rdev);59865986+ if (!test_bit(Faulty, &rdev->flags))59875987+ return -EBUSY;60025988 return 0;60035989}60045990
+9-5
drivers/md/raid1.c
···10991099 bio_list_add(&conf->pending_bio_list, mbio);11001100 spin_unlock_irqrestore(&conf->device_lock, flags);11011101 }11021102- r1_bio_write_done(r1_bio);11031103-11041104- /* In case raid1d snuck in to freeze_array */11051105- wake_up(&conf->wait_barrier);11061106-11021102+ /* Mustn't call r1_bio_write_done before this next test,11031103+ * as it could result in the bio being freed.11041104+ */11071105 if (sectors_handled < (bio->bi_size >> 9)) {11061106+ r1_bio_write_done(r1_bio);11081107 /* We need another r1_bio. It has already been counted11091108 * in bio->bi_phys_segments11101109 */···11151116 r1_bio->sector = bio->bi_sector + sectors_handled;11161117 goto retry_write;11171118 }11191119+11201120+ r1_bio_write_done(r1_bio);11211121+11221122+ /* In case raid1d snuck in to freeze_array */11231123+ wake_up(&conf->wait_barrier);1118112411191125 if (do_sync || !bitmap || !plugged)11201126 md_wakeup_thread(mddev->thread);
+24-23
drivers/md/raid10.c
···337337 md_write_end(r10_bio->mddev);338338}339339340340+static void one_write_done(r10bio_t *r10_bio)341341+{342342+ if (atomic_dec_and_test(&r10_bio->remaining)) {343343+ if (test_bit(R10BIO_WriteError, &r10_bio->state))344344+ reschedule_retry(r10_bio);345345+ else {346346+ close_write(r10_bio);347347+ if (test_bit(R10BIO_MadeGood, &r10_bio->state))348348+ reschedule_retry(r10_bio);349349+ else350350+ raid_end_bio_io(r10_bio);351351+ }352352+ }353353+}354354+340355static void raid10_end_write_request(struct bio *bio, int error)341356{342357 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);···402387 * Let's see if all mirrored write operations have finished403388 * already.404389 */405405- if (atomic_dec_and_test(&r10_bio->remaining)) {406406- if (test_bit(R10BIO_WriteError, &r10_bio->state))407407- reschedule_retry(r10_bio);408408- else {409409- close_write(r10_bio);410410- if (test_bit(R10BIO_MadeGood, &r10_bio->state))411411- reschedule_retry(r10_bio);412412- else413413- raid_end_bio_io(r10_bio);414414- }415415- }390390+ one_write_done(r10_bio);416391 if (dec_rdev)417392 rdev_dec_pending(conf->mirrors[dev].rdev, conf->mddev);418393}···11321127 spin_unlock_irqrestore(&conf->device_lock, flags);11331128 }1134112911351135- if (atomic_dec_and_test(&r10_bio->remaining)) {11361136- /* This matches the end of raid10_end_write_request() */11371137- bitmap_endwrite(r10_bio->mddev->bitmap, r10_bio->sector,11381138- r10_bio->sectors,11391139- !test_bit(R10BIO_Degraded, &r10_bio->state),11401140- 0);11411141- md_write_end(mddev);11421142- raid_end_bio_io(r10_bio);11431143- }11441144-11451145- /* In case raid10d snuck in to freeze_array */11461146- wake_up(&conf->wait_barrier);11301130+ /* Don't remove the bias on 'remaining' (one_write_done) until11311131+ * after checking if we need to go around again.11321132+ */1147113311481134 if (sectors_handled < (bio->bi_size >> 9)) {11351135+ one_write_done(r10_bio);11491136 /* We need another r10_bio. It has already been counted11501137 * in bio->bi_phys_segments.11511138 */···11511154 r10_bio->state = 0;11521155 goto retry_write;11531156 }11571157+ one_write_done(r10_bio);11581158+11591159+ /* In case raid10d snuck in to freeze_array */11601160+ wake_up(&conf->wait_barrier);1154116111551162 if (do_sync || !mddev->bitmap || !plugged)11561163 md_wakeup_thread(mddev->thread);
+1-1
drivers/md/raid5.c
···3336333633373337finish:33383338 /* wait for this device to become unblocked */33393339- if (unlikely(s.blocked_rdev))33393339+ if (conf->mddev->external && unlikely(s.blocked_rdev))33403340 md_wait_for_blocked_rdev(s.blocked_rdev, conf->mddev);3341334133423342 if (s.handle_bad_blocks)
···338338 if (pdev->restore_factory)339339 pdev->restore_factory->flags = V4L2_CTRL_FLAG_UPDATE;340340341341- if (!pdev->features & FEATURE_MOTOR_PANTILT)341341+ if (!(pdev->features & FEATURE_MOTOR_PANTILT))342342 return hdl->error;343343344344 /* Motor pan / tilt / reset */
···1717 * along with this program. If not, see <http://www.gnu.org/licenses/>.1818 */1919#include <linux/kernel.h>2020+#include <linux/module.h>2021#include <linux/types.h>2122#include <linux/slab.h>2223#include <linux/delay.h>···677676 | OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF678677 | OMAP_TLL_CHANNEL_CONF_ULPIDDRMODE);679678680680- reg |= (1 << (i + 1));681679 } else682680 continue;683681
+2
drivers/mfd/tps65910-irq.c
···178178 switch (tps65910_chip_id(tps65910)) {179179 case TPS65910:180180 tps65910->irq_num = TPS65910_NUM_IRQ;181181+ break;181182 case TPS65911:182183 tps65910->irq_num = TPS65911_NUM_IRQ;184184+ break;183185 }184186185187 /* Register with genirq */
+4-1
drivers/mfd/twl4030-madc.c
···510510 u8 ch_msb, ch_lsb;511511 int ret;512512513513- if (!req)513513+ if (!req || !twl4030_madc)514514 return -EINVAL;515515+515516 mutex_lock(&twl4030_madc->lock);516517 if (req->method < TWL4030_MADC_RT || req->method > TWL4030_MADC_SW2) {517518 ret = -EINVAL;···706705 madc = kzalloc(sizeof(*madc), GFP_KERNEL);707706 if (!madc)708707 return -ENOMEM;708708+709709+ madc->dev = &pdev->dev;709710710711 /*711712 * Phoenix provides 2 interrupt lines. The first one is connected to
+2-2
drivers/mfd/wm8350-gpio.c
···3737 return ret;3838}39394040-static int gpio_set_debounce(struct wm8350 *wm8350, int gpio, int db)4040+static int wm8350_gpio_set_debounce(struct wm8350 *wm8350, int gpio, int db)4141{4242 if (db == WM8350_GPIO_DEBOUNCE_ON)4343 return wm8350_set_bits(wm8350, WM8350_GPIO_DEBOUNCE,···210210 goto err;211211 if (gpio_set_polarity(wm8350, gpio, pol))212212 goto err;213213- if (gpio_set_debounce(wm8350, gpio, debounce))213213+ if (wm8350_gpio_set_debounce(wm8350, gpio, debounce))214214 goto err;215215 if (gpio_set_dir(wm8350, gpio, dir))216216 goto err;
+5-7
drivers/misc/pti.c
···165165static void pti_control_frame_built_and_sent(struct pti_masterchannel *mc,166166 const char *thread_name)167167{168168+ /*169169+ * Since we access the comm member in current's task_struct, we only170170+ * need to be as large as what 'comm' in that structure is.171171+ */172172+ char comm[TASK_COMM_LEN];168173 struct pti_masterchannel mccontrol = {.master = CONTROL_ID,169174 .channel = 0};170175 const char *thread_name_p;···177172 u8 control_frame[CONTROL_FRAME_LEN];178173179174 if (!thread_name) {180180- /*181181- * Since we access the comm member in current's task_struct,182182- * we only need to be as large as what 'comm' in that183183- * structure is.184184- */185185- char comm[TASK_COMM_LEN];186186-187175 if (!in_interrupt())188176 get_task_comm(comm, current);189177 else
+31-4
drivers/mmc/core/core.c
···133133 if (mrq->done)134134 mrq->done(mrq);135135136136- mmc_host_clk_gate(host);136136+ mmc_host_clk_release(host);137137 }138138}139139···192192 mrq->stop->mrq = mrq;193193 }194194 }195195- mmc_host_clk_ungate(host);195195+ mmc_host_clk_hold(host);196196 led_trigger_event(host->led, LED_FULL);197197 host->ops->request(host, mrq);198198}···728728 */729729void mmc_set_chip_select(struct mmc_host *host, int mode)730730{731731+ mmc_host_clk_hold(host);731732 host->ios.chip_select = mode;732733 mmc_set_ios(host);734734+ mmc_host_clk_release(host);733735}734736735737/*736738 * Sets the host clock to the highest possible frequency that737739 * is below "hz".738740 */739739-void mmc_set_clock(struct mmc_host *host, unsigned int hz)741741+static void __mmc_set_clock(struct mmc_host *host, unsigned int hz)740742{741743 WARN_ON(hz < host->f_min);742744···747745748746 host->ios.clock = hz;749747 mmc_set_ios(host);748748+}749749+750750+void mmc_set_clock(struct mmc_host *host, unsigned int hz)751751+{752752+ mmc_host_clk_hold(host);753753+ __mmc_set_clock(host, hz);754754+ mmc_host_clk_release(host);750755}751756752757#ifdef CONFIG_MMC_CLKGATE···788779 if (host->clk_old) {789780 BUG_ON(host->ios.clock);790781 /* This call will also set host->clk_gated to false */791791- mmc_set_clock(host, host->clk_old);782782+ __mmc_set_clock(host, host->clk_old);792783 }793784}794785···816807 */817808void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode)818809{810810+ mmc_host_clk_hold(host);819811 host->ios.bus_mode = mode;820812 mmc_set_ios(host);813813+ mmc_host_clk_release(host);821814}822815823816/*···827816 */828817void mmc_set_bus_width(struct mmc_host *host, unsigned int width)829818{819819+ mmc_host_clk_hold(host);830820 host->ios.bus_width = width;831821 mmc_set_ios(host);822822+ mmc_host_clk_release(host);832823}833824834825/**···1028101510291016 ocr &= 3 << bit;1030101710181018+ mmc_host_clk_hold(host);10311019 host->ios.vdd = bit;10321020 mmc_set_ios(host);10211021+ mmc_host_clk_release(host);10331022 } else {10341023 pr_warning("%s: host doesn't support card's voltages\n",10351024 mmc_hostname(host));···10781063 */10791064void mmc_set_timing(struct mmc_host *host, unsigned int timing)10801065{10661066+ mmc_host_clk_hold(host);10811067 host->ios.timing = timing;10821068 mmc_set_ios(host);10691069+ mmc_host_clk_release(host);10831070}1084107110851072/*···10891072 */10901073void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type)10911074{10751075+ mmc_host_clk_hold(host);10921076 host->ios.drv_type = drv_type;10931077 mmc_set_ios(host);10781078+ mmc_host_clk_release(host);10941079}1095108010961081/*···11091090static void mmc_power_up(struct mmc_host *host)11101091{11111092 int bit;10931093+10941094+ mmc_host_clk_hold(host);1112109511131096 /* If ocr is set, we use it */11141097 if (host->ocr)···11471126 * time required to reach a stable voltage.11481127 */11491128 mmc_delay(10);11291129+11301130+ mmc_host_clk_release(host);11501131}1151113211521133static void mmc_power_off(struct mmc_host *host)11531134{11351135+ mmc_host_clk_hold(host);11361136+11541137 host->ios.clock = 0;11551138 host->ios.vdd = 0;11561139···11721147 host->ios.bus_width = MMC_BUS_WIDTH_1;11731148 host->ios.timing = MMC_TIMING_LEGACY;11741149 mmc_set_ios(host);11501150+11511151+ mmc_host_clk_release(host);11751152}1176115311771154/*
+6-6
drivers/mmc/core/host.c
···119119}120120121121/**122122- * mmc_host_clk_ungate - ungate hardware MCI clocks122122+ * mmc_host_clk_hold - ungate hardware MCI clocks123123 * @host: host to ungate.124124 *125125 * Makes sure the host ios.clock is restored to a non-zero value126126 * past this call. Increase clock reference count and ungate clock127127 * if we're the first user.128128 */129129-void mmc_host_clk_ungate(struct mmc_host *host)129129+void mmc_host_clk_hold(struct mmc_host *host)130130{131131 unsigned long flags;132132···164164}165165166166/**167167- * mmc_host_clk_gate - gate off hardware MCI clocks167167+ * mmc_host_clk_release - gate off hardware MCI clocks168168 * @host: host to gate.169169 *170170 * Calls the host driver with ios.clock set to zero as often as possible171171 * in order to gate off hardware MCI clocks. Decrease clock reference172172 * count and schedule disabling of clock.173173 */174174-void mmc_host_clk_gate(struct mmc_host *host)174174+void mmc_host_clk_release(struct mmc_host *host)175175{176176 unsigned long flags;177177···179179 host->clk_requests--;180180 if (mmc_host_may_gate_card(host->card) &&181181 !host->clk_requests)182182- schedule_work(&host->clk_gate_work);182182+ queue_work(system_nrt_wq, &host->clk_gate_work);183183 spin_unlock_irqrestore(&host->clk_lock, flags);184184}185185···231231 if (cancel_work_sync(&host->clk_gate_work))232232 mmc_host_clk_gate_delayed(host);233233 if (host->clk_gated)234234- mmc_host_clk_ungate(host);234234+ mmc_host_clk_hold(host);235235 /* There should be only one user now */236236 WARN_ON(host->clk_requests > 1);237237}
···181181182182#define ubi_dbg_msg(fmt, ...) do { \183183 if (0) \184184- pr_debug(fmt "\n", ##__VA_ARGS__); \184184+ printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \185185} while (0)186186187187#define dbg_msg(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__)
+6-5
drivers/net/Kconfig
···25352535source "drivers/net/stmmac/Kconfig"2536253625372537config PCH_GBE25382538- tristate "Intel EG20T PCH / OKI SEMICONDUCTOR ML7223 IOH GbE"25382538+ tristate "Intel EG20T PCH/OKI SEMICONDUCTOR IOH(ML7223/ML7831) GbE"25392539 depends on PCI25402540 select MII25412541 ---help---···25482548 This driver enables Gigabit Ethernet function.2549254925502550 This driver also can be used for OKI SEMICONDUCTOR IOH(Input/25512551- Output Hub), ML7223.25522552- ML7223 IOH is for MP(Media Phone) use.25532553- ML7223 is companion chip for Intel Atom E6xx series.25542554- ML7223 is completely compatible for Intel EG20T PCH.25512551+ Output Hub), ML7223/ML7831.25522552+ ML7223 IOH is for MP(Media Phone) use. ML7831 IOH is for general25532553+ purpose use.25542554+ ML7223/ML7831 is companion chip for Intel Atom E6xx series.25552555+ ML7223/ML7831 is completely compatible for Intel EG20T PCH.2555255625562557config FTGMAC10025572558 tristate "Faraday FTGMAC100 Gigabit Ethernet support"
···40264026 checksum += eeprom_data;40274027 }4028402840294029+#ifdef CONFIG_PARISC40304030+ /* This is a signature and not a checksum on HP c8000 */40314031+ if ((hw->subsystem_vendor_id == 0x103C) && (eeprom_data == 0x16d6))40324032+ return E1000_SUCCESS;40334033+40344034+#endif40294035 if (checksum == (u16) EEPROM_SUM)40304036 return E1000_SUCCESS;40314037 else {
+31-17
drivers/net/ibmveth.c
···757757 struct ibmveth_adapter *adapter = netdev_priv(dev);758758 unsigned long set_attr, clr_attr, ret_attr;759759 unsigned long set_attr6, clr_attr6;760760- long ret, ret6;760760+ long ret, ret4, ret6;761761 int rc1 = 0, rc2 = 0;762762 int restart = 0;763763···770770771771 set_attr = 0;772772 clr_attr = 0;773773+ set_attr6 = 0;774774+ clr_attr6 = 0;773775774776 if (data) {775777 set_attr = IBMVETH_ILLAN_IPV4_TCP_CSUM;···786784 if (ret == H_SUCCESS && !(ret_attr & IBMVETH_ILLAN_ACTIVE_TRUNK) &&787785 !(ret_attr & IBMVETH_ILLAN_TRUNK_PRI_MASK) &&788786 (ret_attr & IBMVETH_ILLAN_PADDED_PKT_CSUM)) {789789- ret = h_illan_attributes(adapter->vdev->unit_address, clr_attr,787787+ ret4 = h_illan_attributes(adapter->vdev->unit_address, clr_attr,790788 set_attr, &ret_attr);791789792792- if (ret != H_SUCCESS) {790790+ if (ret4 != H_SUCCESS) {793791 netdev_err(dev, "unable to change IPv4 checksum "794792 "offload settings. %d rc=%ld\n",795795- data, ret);793793+ data, ret4);796794797797- ret = h_illan_attributes(adapter->vdev->unit_address,798798- set_attr, clr_attr, &ret_attr);795795+ h_illan_attributes(adapter->vdev->unit_address,796796+ set_attr, clr_attr, &ret_attr);797797+798798+ if (data == 1)799799+ dev->features &= ~NETIF_F_IP_CSUM;800800+799801 } else {800802 adapter->fw_ipv4_csum_support = data;801803 }···810804 if (ret6 != H_SUCCESS) {811805 netdev_err(dev, "unable to change IPv6 checksum "812806 "offload settings. %d rc=%ld\n",813813- data, ret);807807+ data, ret6);814808815815- ret = h_illan_attributes(adapter->vdev->unit_address,816816- set_attr6, clr_attr6,817817- &ret_attr);809809+ h_illan_attributes(adapter->vdev->unit_address,810810+ set_attr6, clr_attr6, &ret_attr);811811+812812+ if (data == 1)813813+ dev->features &= ~NETIF_F_IPV6_CSUM;814814+818815 } else819816 adapter->fw_ipv6_csum_support = data;820817821821- if (ret != H_SUCCESS || ret6 != H_SUCCESS)818818+ if (ret4 == H_SUCCESS || ret6 == H_SUCCESS)822819 adapter->rx_csum = data;823820 else824821 rc1 = -EIO;···939930 union ibmveth_buf_desc descs[6];940931 int last, i;941932 int force_bounce = 0;933933+ dma_addr_t dma_addr;942934943935 /*944936 * veth handles a maximum of 6 segments including the header, so···1004994 }10059951006996 /* Map the header */10071007- descs[0].fields.address = dma_map_single(&adapter->vdev->dev, skb->data,10081008- skb_headlen(skb),10091009- DMA_TO_DEVICE);10101010- if (dma_mapping_error(&adapter->vdev->dev, descs[0].fields.address))997997+ dma_addr = dma_map_single(&adapter->vdev->dev, skb->data,998998+ skb_headlen(skb), DMA_TO_DEVICE);999999+ if (dma_mapping_error(&adapter->vdev->dev, dma_addr))10111000 goto map_failed;1012100110131002 descs[0].fields.flags_len = desc_flags | skb_headlen(skb);10031003+ descs[0].fields.address = dma_addr;1014100410151005 /* Map the frags */10161006 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {10171017- unsigned long dma_addr;10181007 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];1019100810201009 dma_addr = dma_map_page(&adapter->vdev->dev, frag->page,···10351026 netdev->stats.tx_bytes += skb->len;10361027 }1037102810381038- for (i = 0; i < skb_shinfo(skb)->nr_frags + 1; i++)10291029+ dma_unmap_single(&adapter->vdev->dev,10301030+ descs[0].fields.address,10311031+ descs[0].fields.flags_len & IBMVETH_BUF_LEN_MASK,10321032+ DMA_TO_DEVICE);10331033+10341034+ for (i = 1; i < skb_shinfo(skb)->nr_frags + 1; i++)10391035 dma_unmap_page(&adapter->vdev->dev, descs[i].fields.address,10401036 descs[i].fields.flags_len & IBMVETH_BUF_LEN_MASK,10411037 DMA_TO_DEVICE);
+10-2
drivers/net/pch_gbe/pch_gbe.h
···127127128128/* Reset */129129#define PCH_GBE_ALL_RST 0x80000000 /* All reset */130130-#define PCH_GBE_TX_RST 0x40000000 /* TX MAC, TX FIFO, TX DMA reset */131131-#define PCH_GBE_RX_RST 0x04000000 /* RX MAC, RX FIFO, RX DMA reset */130130+#define PCH_GBE_TX_RST 0x00008000 /* TX MAC, TX FIFO, TX DMA reset */131131+#define PCH_GBE_RX_RST 0x00004000 /* RX MAC, RX FIFO, RX DMA reset */132132133133/* TCP/IP Accelerator Control */134134#define PCH_GBE_EX_LIST_EN 0x00000008 /* External List Enable */···275275/* DMA Control */276276#define PCH_GBE_RX_DMA_EN 0x00000002 /* Enables Receive DMA */277277#define PCH_GBE_TX_DMA_EN 0x00000001 /* Enables Transmission DMA */278278+279279+/* RX DMA STATUS */280280+#define PCH_GBE_IDLE_CHECK 0xFFFFFFFE278281279282/* Wake On LAN Status */280283#define PCH_GBE_WLS_BR 0x00000008 /* Broadcas Address */···474471struct pch_gbe_buffer {475472 struct sk_buff *skb;476473 dma_addr_t dma;474474+ unsigned char *rx_buffer;477475 unsigned long time_stamp;478476 u16 length;479477 bool mapped;···515511struct pch_gbe_rx_ring {516512 struct pch_gbe_rx_desc *desc;517513 dma_addr_t dma;514514+ unsigned char *rx_buff_pool;515515+ dma_addr_t rx_buff_pool_logic;516516+ unsigned int rx_buff_pool_size;518517 unsigned int size;519518 unsigned int count;520519 unsigned int next_to_use;···629622 unsigned long rx_buffer_len;630623 unsigned long tx_queue_len;631624 bool have_msi;625625+ bool rx_stop_flag;632626};633627634628extern const char pch_driver_version[];
+192-108
drivers/net/pch_gbe/pch_gbe_main.c
···20202121#include "pch_gbe.h"2222#include "pch_gbe_api.h"2323-#include <linux/prefetch.h>24232524#define DRV_VERSION "1.00"2625const char pch_driver_version[] = DRV_VERSION;···3334#define PCH_GBE_WATCHDOG_PERIOD (1 * HZ) /* watchdog time */3435#define PCH_GBE_COPYBREAK_DEFAULT 2563536#define PCH_GBE_PCI_BAR 13737+#define PCH_GBE_RESERVE_MEMORY 0x200000 /* 2MB */36383739/* Macros for ML7223 */3840#define PCI_VENDOR_ID_ROHM 0x10db3941#define PCI_DEVICE_ID_ROHM_ML7223_GBE 0x80134242+4343+/* Macros for ML7831 */4444+#define PCI_DEVICE_ID_ROHM_ML7831_GBE 0x880240454146#define PCH_GBE_TX_WEIGHT 644247#define PCH_GBE_RX_WEIGHT 64···5552 )56535754/* Ethertype field values */5555+#define PCH_GBE_MAX_RX_BUFFER_SIZE 0x28805856#define PCH_GBE_MAX_JUMBO_FRAME_SIZE 103185957#define PCH_GBE_FRAME_SIZE_2048 20486058#define PCH_GBE_FRAME_SIZE_4096 4096···8783#define PCH_GBE_INT_ENABLE_MASK ( \8884 PCH_GBE_INT_RX_DMA_CMPLT | \8985 PCH_GBE_INT_RX_DSC_EMP | \8686+ PCH_GBE_INT_RX_FIFO_ERR | \9087 PCH_GBE_INT_WOL_DET | \9188 PCH_GBE_INT_TX_CMPLT \9289 )93909191+#define PCH_GBE_INT_DISABLE_ALL 094929593static unsigned int copybreak __read_mostly = PCH_GBE_COPYBREAK_DEFAULT;9694···144138 if (!tmp)145139 pr_err("Error: busy bit is not cleared\n");146140}141141+142142+/**143143+ * pch_gbe_wait_clr_bit_irq - Wait to clear a bit for interrupt context144144+ * @reg: Pointer of register145145+ * @busy: Busy bit146146+ */147147+static int pch_gbe_wait_clr_bit_irq(void *reg, u32 bit)148148+{149149+ u32 tmp;150150+ int ret = -1;151151+ /* wait busy */152152+ tmp = 20;153153+ while ((ioread32(reg) & bit) && --tmp)154154+ udelay(5);155155+ if (!tmp)156156+ pr_err("Error: busy bit is not cleared\n");157157+ else158158+ ret = 0;159159+ return ret;160160+}161161+147162/**148163 * pch_gbe_mac_mar_set - Set MAC address register149164 * @hw: Pointer to the HW structure···212185#endif213186 pch_gbe_wait_clr_bit(&hw->reg->RESET, PCH_GBE_ALL_RST);214187 /* Setup the receive address */188188+ pch_gbe_mac_mar_set(hw, hw->mac.addr, 0);189189+ return;190190+}191191+192192+static void pch_gbe_mac_reset_rx(struct pch_gbe_hw *hw)193193+{194194+ /* Read the MAC address. and store to the private data */195195+ pch_gbe_mac_read_mac_addr(hw);196196+ iowrite32(PCH_GBE_RX_RST, &hw->reg->RESET);197197+ pch_gbe_wait_clr_bit_irq(&hw->reg->RESET, PCH_GBE_RX_RST);198198+ /* Setup the MAC address */215199 pch_gbe_mac_mar_set(hw, hw->mac.addr, 0);216200 return;217201}···709671710672 tcpip = ioread32(&hw->reg->TCPIP_ACC);711673712712- if (netdev->features & NETIF_F_RXCSUM) {713713- tcpip &= ~PCH_GBE_RX_TCPIPACC_OFF;714714- tcpip |= PCH_GBE_RX_TCPIPACC_EN;715715- } else {716716- tcpip |= PCH_GBE_RX_TCPIPACC_OFF;717717- tcpip &= ~PCH_GBE_RX_TCPIPACC_EN;718718- }674674+ tcpip |= PCH_GBE_RX_TCPIPACC_OFF;675675+ tcpip &= ~PCH_GBE_RX_TCPIPACC_EN;719676 iowrite32(tcpip, &hw->reg->TCPIP_ACC);720677 return;721678}···750717 iowrite32(rdba, &hw->reg->RX_DSC_BASE);751718 iowrite32(rdlen, &hw->reg->RX_DSC_SIZE);752719 iowrite32((rdba + rdlen), &hw->reg->RX_DSC_SW_P);753753-754754- /* Enables Receive DMA */755755- rxdma = ioread32(&hw->reg->DMA_CTRL);756756- rxdma |= PCH_GBE_RX_DMA_EN;757757- iowrite32(rxdma, &hw->reg->DMA_CTRL);758758- /* Enables Receive */759759- iowrite32(PCH_GBE_MRE_MAC_RX_EN, &hw->reg->MAC_RX_EN);760720}761721762722/**···11231097 spin_unlock_irqrestore(&adapter->stats_lock, flags);11241098}1125109911001100+static void pch_gbe_stop_receive(struct pch_gbe_adapter *adapter)11011101+{11021102+ struct pch_gbe_hw *hw = &adapter->hw;11031103+ u32 rxdma;11041104+ u16 value;11051105+ int ret;11061106+11071107+ /* Disable Receive DMA */11081108+ rxdma = ioread32(&hw->reg->DMA_CTRL);11091109+ rxdma &= ~PCH_GBE_RX_DMA_EN;11101110+ iowrite32(rxdma, &hw->reg->DMA_CTRL);11111111+ /* Wait Rx DMA BUS is IDLE */11121112+ ret = pch_gbe_wait_clr_bit_irq(&hw->reg->RX_DMA_ST, PCH_GBE_IDLE_CHECK);11131113+ if (ret) {11141114+ /* Disable Bus master */11151115+ pci_read_config_word(adapter->pdev, PCI_COMMAND, &value);11161116+ value &= ~PCI_COMMAND_MASTER;11171117+ pci_write_config_word(adapter->pdev, PCI_COMMAND, value);11181118+ /* Stop Receive */11191119+ pch_gbe_mac_reset_rx(hw);11201120+ /* Enable Bus master */11211121+ value |= PCI_COMMAND_MASTER;11221122+ pci_write_config_word(adapter->pdev, PCI_COMMAND, value);11231123+ } else {11241124+ /* Stop Receive */11251125+ pch_gbe_mac_reset_rx(hw);11261126+ }11271127+}11281128+11291129+static void pch_gbe_start_receive(struct pch_gbe_hw *hw)11301130+{11311131+ u32 rxdma;11321132+11331133+ /* Enables Receive DMA */11341134+ rxdma = ioread32(&hw->reg->DMA_CTRL);11351135+ rxdma |= PCH_GBE_RX_DMA_EN;11361136+ iowrite32(rxdma, &hw->reg->DMA_CTRL);11371137+ /* Enables Receive */11381138+ iowrite32(PCH_GBE_MRE_MAC_RX_EN, &hw->reg->MAC_RX_EN);11391139+ return;11401140+}11411141+11261142/**11271143 * pch_gbe_intr - Interrupt Handler11281144 * @irq: Interrupt number···11911123 if (int_st & PCH_GBE_INT_RX_FRAME_ERR)11921124 adapter->stats.intr_rx_frame_err_count++;11931125 if (int_st & PCH_GBE_INT_RX_FIFO_ERR)11941194- adapter->stats.intr_rx_fifo_err_count++;11261126+ if (!adapter->rx_stop_flag) {11271127+ adapter->stats.intr_rx_fifo_err_count++;11281128+ pr_debug("Rx fifo over run\n");11291129+ adapter->rx_stop_flag = true;11301130+ int_en = ioread32(&hw->reg->INT_EN);11311131+ iowrite32((int_en & ~PCH_GBE_INT_RX_FIFO_ERR),11321132+ &hw->reg->INT_EN);11331133+ pch_gbe_stop_receive(adapter);11341134+ }11951135 if (int_st & PCH_GBE_INT_RX_DMA_ERR)11961136 adapter->stats.intr_rx_dma_err_count++;11971137 if (int_st & PCH_GBE_INT_TX_FIFO_ERR)···12111135 /* When Rx descriptor is empty */12121136 if ((int_st & PCH_GBE_INT_RX_DSC_EMP)) {12131137 adapter->stats.intr_rx_dsc_empty_count++;12141214- pr_err("Rx descriptor is empty\n");11381138+ pr_debug("Rx descriptor is empty\n");12151139 int_en = ioread32(&hw->reg->INT_EN);12161140 iowrite32((int_en & ~PCH_GBE_INT_RX_DSC_EMP), &hw->reg->INT_EN);12171141 if (hw->mac.tx_fc_enable) {···12611185 unsigned int i;12621186 unsigned int bufsz;1263118712641264- bufsz = adapter->rx_buffer_len + PCH_GBE_DMA_ALIGN;11881188+ bufsz = adapter->rx_buffer_len + NET_IP_ALIGN;12651189 i = rx_ring->next_to_use;1266119012671191 while ((cleaned_count--)) {12681192 buffer_info = &rx_ring->buffer_info[i];12691269- skb = buffer_info->skb;12701270- if (skb) {12711271- skb_trim(skb, 0);12721272- } else {12731273- skb = netdev_alloc_skb(netdev, bufsz);12741274- if (unlikely(!skb)) {12751275- /* Better luck next round */12761276- adapter->stats.rx_alloc_buff_failed++;12771277- break;12781278- }12791279- /* 64byte align */12801280- skb_reserve(skb, PCH_GBE_DMA_ALIGN);12811281-12821282- buffer_info->skb = skb;12831283- buffer_info->length = adapter->rx_buffer_len;11931193+ skb = netdev_alloc_skb(netdev, bufsz);11941194+ if (unlikely(!skb)) {11951195+ /* Better luck next round */11961196+ adapter->stats.rx_alloc_buff_failed++;11971197+ break;12841198 }11991199+ /* align */12001200+ skb_reserve(skb, NET_IP_ALIGN);12011201+ buffer_info->skb = skb;12021202+12851203 buffer_info->dma = dma_map_single(&pdev->dev,12861286- skb->data,12041204+ buffer_info->rx_buffer,12871205 buffer_info->length,12881206 DMA_FROM_DEVICE);12891207 if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma)) {···13081238 &hw->reg->RX_DSC_SW_P);13091239 }13101240 return;12411241+}12421242+12431243+static int12441244+pch_gbe_alloc_rx_buffers_pool(struct pch_gbe_adapter *adapter,12451245+ struct pch_gbe_rx_ring *rx_ring, int cleaned_count)12461246+{12471247+ struct pci_dev *pdev = adapter->pdev;12481248+ struct pch_gbe_buffer *buffer_info;12491249+ unsigned int i;12501250+ unsigned int bufsz;12511251+ unsigned int size;12521252+12531253+ bufsz = adapter->rx_buffer_len;12541254+12551255+ size = rx_ring->count * bufsz + PCH_GBE_RESERVE_MEMORY;12561256+ rx_ring->rx_buff_pool = dma_alloc_coherent(&pdev->dev, size,12571257+ &rx_ring->rx_buff_pool_logic,12581258+ GFP_KERNEL);12591259+ if (!rx_ring->rx_buff_pool) {12601260+ pr_err("Unable to allocate memory for the receive poll buffer\n");12611261+ return -ENOMEM;12621262+ }12631263+ memset(rx_ring->rx_buff_pool, 0, size);12641264+ rx_ring->rx_buff_pool_size = size;12651265+ for (i = 0; i < rx_ring->count; i++) {12661266+ buffer_info = &rx_ring->buffer_info[i];12671267+ buffer_info->rx_buffer = rx_ring->rx_buff_pool + bufsz * i;12681268+ buffer_info->length = bufsz;12691269+ }12701270+ return 0;13111271}1312127213131273/**···14801380 unsigned int i;14811381 unsigned int cleaned_count = 0;14821382 bool cleaned = false;14831483- struct sk_buff *skb, *new_skb;13831383+ struct sk_buff *skb;14841384 u8 dma_status;14851385 u16 gbec_status;14861386 u32 tcp_ip_status;···15011401 rx_desc->gbec_status = DSC_INIT16;15021402 buffer_info = &rx_ring->buffer_info[i];15031403 skb = buffer_info->skb;14041404+ buffer_info->skb = NULL;1504140515051406 /* unmap dma */15061407 dma_unmap_single(&pdev->dev, buffer_info->dma,15071408 buffer_info->length, DMA_FROM_DEVICE);15081409 buffer_info->mapped = false;15091509- /* Prefetch the packet */15101510- prefetch(skb->data);1511141015121411 pr_debug("RxDecNo = 0x%04x Status[DMA:0x%02x GBE:0x%04x "15131412 "TCP:0x%08x] BufInf = 0x%p\n",···15261427 pr_err("Receive CRC Error\n");15271428 } else {15281429 /* get receive length */15291529- /* length convert[-3] */15301530- length = (rx_desc->rx_words_eob) - 3;14301430+ /* length convert[-3], length includes FCS length */14311431+ length = (rx_desc->rx_words_eob) - 3 - ETH_FCS_LEN;14321432+ if (rx_desc->rx_words_eob & 0x02)14331433+ length = length - 4;14341434+ /*14351435+ * buffer_info->rx_buffer: [Header:14][payload]14361436+ * skb->data: [Reserve:2][Header:14][payload]14371437+ */14381438+ memcpy(skb->data, buffer_info->rx_buffer, length);1531143915321532- /* Decide the data conversion method */15331533- if (!(netdev->features & NETIF_F_RXCSUM)) {15341534- /* [Header:14][payload] */15351535- if (NET_IP_ALIGN) {15361536- /* Because alignment differs,15371537- * the new_skb is newly allocated,15381538- * and data is copied to new_skb.*/15391539- new_skb = netdev_alloc_skb(netdev,15401540- length + NET_IP_ALIGN);15411541- if (!new_skb) {15421542- /* dorrop error */15431543- pr_err("New skb allocation "15441544- "Error\n");15451545- goto dorrop;15461546- }15471547- skb_reserve(new_skb, NET_IP_ALIGN);15481548- memcpy(new_skb->data, skb->data,15491549- length);15501550- skb = new_skb;15511551- } else {15521552- /* DMA buffer is used as SKB as it is.*/15531553- buffer_info->skb = NULL;15541554- }15551555- } else {15561556- /* [Header:14][padding:2][payload] */15571557- /* The length includes padding length */15581558- length = length - PCH_GBE_DMA_PADDING;15591559- if ((length < copybreak) ||15601560- (NET_IP_ALIGN != PCH_GBE_DMA_PADDING)) {15611561- /* Because alignment differs,15621562- * the new_skb is newly allocated,15631563- * and data is copied to new_skb.15641564- * Padding data is deleted15651565- * at the time of a copy.*/15661566- new_skb = netdev_alloc_skb(netdev,15671567- length + NET_IP_ALIGN);15681568- if (!new_skb) {15691569- /* dorrop error */15701570- pr_err("New skb allocation "15711571- "Error\n");15721572- goto dorrop;15731573- }15741574- skb_reserve(new_skb, NET_IP_ALIGN);15751575- memcpy(new_skb->data, skb->data,15761576- ETH_HLEN);15771577- memcpy(&new_skb->data[ETH_HLEN],15781578- &skb->data[ETH_HLEN +15791579- PCH_GBE_DMA_PADDING],15801580- length - ETH_HLEN);15811581- skb = new_skb;15821582- } else {15831583- /* Padding data is deleted15841584- * by moving header data.*/15851585- memmove(&skb->data[PCH_GBE_DMA_PADDING],15861586- &skb->data[0], ETH_HLEN);15871587- skb_reserve(skb, NET_IP_ALIGN);15881588- buffer_info->skb = NULL;15891589- }15901590- }15911591- /* The length includes FCS length */15921592- length = length - ETH_FCS_LEN;15931440 /* update status of driver */15941441 adapter->stats.rx_bytes += length;15951442 adapter->stats.rx_packets++;···15541509 pr_debug("Receive skb->ip_summed: %d length: %d\n",15551510 skb->ip_summed, length);15561511 }15571557-dorrop:15581512 /* return some buffers to hardware, one at a time is too slow */15591513 if (unlikely(cleaned_count >= PCH_GBE_RX_BUFFER_WRITE)) {15601514 pch_gbe_alloc_rx_buffers(adapter, rx_ring,···17581714 pr_err("Error: can't bring device up\n");17591715 return err;17601716 }17171717+ err = pch_gbe_alloc_rx_buffers_pool(adapter, rx_ring, rx_ring->count);17181718+ if (err) {17191719+ pr_err("Error: can't bring device up\n");17201720+ return err;17211721+ }17611722 pch_gbe_alloc_tx_buffers(adapter, tx_ring);17621723 pch_gbe_alloc_rx_buffers(adapter, rx_ring, rx_ring->count);17631724 adapter->tx_queue_len = netdev->tx_queue_len;17251725+ pch_gbe_start_receive(&adapter->hw);1764172617651727 mod_timer(&adapter->watchdog_timer, jiffies);17661728···17841734void pch_gbe_down(struct pch_gbe_adapter *adapter)17851735{17861736 struct net_device *netdev = adapter->netdev;17371737+ struct pch_gbe_rx_ring *rx_ring = adapter->rx_ring;1787173817881739 /* signal that we're down so the interrupt handler does not17891740 * reschedule our watchdog timer */···18031752 pch_gbe_reset(adapter);18041753 pch_gbe_clean_tx_ring(adapter, adapter->tx_ring);18051754 pch_gbe_clean_rx_ring(adapter, adapter->rx_ring);17551755+17561756+ pci_free_consistent(adapter->pdev, rx_ring->rx_buff_pool_size,17571757+ rx_ring->rx_buff_pool, rx_ring->rx_buff_pool_logic);17581758+ rx_ring->rx_buff_pool_logic = 0;17591759+ rx_ring->rx_buff_pool_size = 0;17601760+ rx_ring->rx_buff_pool = NULL;18061761}1807176218081763/**···20612004{20622005 struct pch_gbe_adapter *adapter = netdev_priv(netdev);20632006 int max_frame;20072007+ unsigned long old_rx_buffer_len = adapter->rx_buffer_len;20082008+ int err;2064200920652010 max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;20662011 if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||···20772018 else if (max_frame <= PCH_GBE_FRAME_SIZE_8192)20782019 adapter->rx_buffer_len = PCH_GBE_FRAME_SIZE_8192;20792020 else20802080- adapter->rx_buffer_len = PCH_GBE_MAX_JUMBO_FRAME_SIZE;20812081- netdev->mtu = new_mtu;20822082- adapter->hw.mac.max_frame_size = max_frame;20212021+ adapter->rx_buffer_len = PCH_GBE_MAX_RX_BUFFER_SIZE;2083202220842084- if (netif_running(netdev))20852085- pch_gbe_reinit_locked(adapter);20862086- else20232023+ if (netif_running(netdev)) {20242024+ pch_gbe_down(adapter);20252025+ err = pch_gbe_up(adapter);20262026+ if (err) {20272027+ adapter->rx_buffer_len = old_rx_buffer_len;20282028+ pch_gbe_up(adapter);20292029+ return -ENOMEM;20302030+ } else {20312031+ netdev->mtu = new_mtu;20322032+ adapter->hw.mac.max_frame_size = max_frame;20332033+ }20342034+ } else {20872035 pch_gbe_reset(adapter);20362036+ netdev->mtu = new_mtu;20372037+ adapter->hw.mac.max_frame_size = max_frame;20382038+ }2088203920892040 pr_debug("max_frame : %d rx_buffer_len : %d mtu : %d max_frame_size : %d\n",20902041 max_frame, (u32) adapter->rx_buffer_len, netdev->mtu,···21722103 int work_done = 0;21732104 bool poll_end_flag = false;21742105 bool cleaned = false;21062106+ u32 int_en;2175210721762108 pr_debug("budget : %d\n", budget);21772109···21802110 if (!netif_carrier_ok(netdev)) {21812111 poll_end_flag = true;21822112 } else {21832183- cleaned = pch_gbe_clean_tx(adapter, adapter->tx_ring);21842113 pch_gbe_clean_rx(adapter, adapter->rx_ring, &work_done, budget);21142114+ if (adapter->rx_stop_flag) {21152115+ adapter->rx_stop_flag = false;21162116+ pch_gbe_start_receive(&adapter->hw);21172117+ int_en = ioread32(&adapter->hw.reg->INT_EN);21182118+ iowrite32((int_en | PCH_GBE_INT_RX_FIFO_ERR),21192119+ &adapter->hw.reg->INT_EN);21202120+ }21212121+ cleaned = pch_gbe_clean_tx(adapter, adapter->tx_ring);2185212221862123 if (cleaned)21872124 work_done = budget;···25242447 },25252448 {.vendor = PCI_VENDOR_ID_ROHM,25262449 .device = PCI_DEVICE_ID_ROHM_ML7223_GBE,24502450+ .subvendor = PCI_ANY_ID,24512451+ .subdevice = PCI_ANY_ID,24522452+ .class = (PCI_CLASS_NETWORK_ETHERNET << 8),24532453+ .class_mask = (0xFFFF00)24542454+ },24552455+ {.vendor = PCI_VENDOR_ID_ROHM,24562456+ .device = PCI_DEVICE_ID_ROHM_ML7831_GBE,25272457 .subvendor = PCI_ANY_ID,25282458 .subdevice = PCI_ANY_ID,25292459 .class = (PCI_CLASS_NETWORK_ETHERNET << 8),
+2-16
drivers/net/sfc/efx.c
···10501050{10511051 struct pci_dev *pci_dev = efx->pci_dev;10521052 dma_addr_t dma_mask = efx->type->max_dma_mask;10531053- bool use_wc;10541053 int rc;1055105410561055 netif_dbg(efx, probe, efx->net_dev, "initialising I/O\n");···11001101 rc = -EIO;11011102 goto fail3;11021103 }11031103-11041104- /* bug22643: If SR-IOV is enabled then tx push over a write combined11051105- * mapping is unsafe. We need to disable write combining in this case.11061106- * MSI is unsupported when SR-IOV is enabled, and the firmware will11071107- * have removed the MSI capability. So write combining is safe if11081108- * there is an MSI capability.11091109- */11101110- use_wc = (!EFX_WORKAROUND_22643(efx) ||11111111- pci_find_capability(pci_dev, PCI_CAP_ID_MSI));11121112- if (use_wc)11131113- efx->membase = ioremap_wc(efx->membase_phys,11141114- efx->type->mem_map_size);11151115- else11161116- efx->membase = ioremap_nocache(efx->membase_phys,11171117- efx->type->mem_map_size);11041104+ efx->membase = ioremap_nocache(efx->membase_phys,11051105+ efx->type->mem_map_size);11181106 if (!efx->membase) {11191107 netif_err(efx, probe, efx->net_dev,11201108 "could not map memory BAR at %llx+%x\n",
···4141 case ADC_DC_CAL:4242 /* Run ADC Gain Cal for non-CCK & non 2GHz-HT20 only */4343 if (!IS_CHAN_B(chan) &&4444- !(IS_CHAN_2GHZ(chan) && IS_CHAN_HT20(chan)))4444+ !((IS_CHAN_2GHZ(chan) || IS_CHAN_A_FAST_CLOCK(ah, chan)) &&4545+ IS_CHAN_HT20(chan)))4546 supported = true;4647 break;4748 }
+1-1
drivers/net/wireless/ath/ath9k/ar9003_phy.c
···671671 REG_WRITE_ARRAY(&ah->iniModesAdditional,672672 modesIndex, regWrites);673673674674- if (AR_SREV_9300(ah))674674+ if (AR_SREV_9330(ah))675675 REG_WRITE_ARRAY(&ah->iniModesAdditional, 1, regWrites);676676677677 if (AR_SREV_9340(ah) && !ah->is_clk_25mhz)
+6
drivers/net/wireless/ath/ath9k/main.c
···23032303 mutex_lock(&sc->mutex);23042304 cancel_delayed_work_sync(&sc->tx_complete_work);2305230523062306+ if (ah->ah_flags & AH_UNPLUGGED) {23072307+ ath_dbg(common, ATH_DBG_ANY, "Device has been unplugged!\n");23082308+ mutex_unlock(&sc->mutex);23092309+ return;23102310+ }23112311+23062312 if (sc->sc_flags & SC_OP_INVALID) {23072313 ath_dbg(common, ATH_DBG_ANY, "Device not present\n");23082314 mutex_unlock(&sc->mutex);
+8-5
drivers/net/wireless/iwlegacy/iwl-3945-rs.c
···822822823823 out:824824825825- rs_sta->last_txrate_idx = index;826826- if (sband->band == IEEE80211_BAND_5GHZ)827827- info->control.rates[0].idx = rs_sta->last_txrate_idx -828828- IWL_FIRST_OFDM_RATE;829829- else825825+ if (sband->band == IEEE80211_BAND_5GHZ) {826826+ if (WARN_ON_ONCE(index < IWL_FIRST_OFDM_RATE))827827+ index = IWL_FIRST_OFDM_RATE;828828+ rs_sta->last_txrate_idx = index;829829+ info->control.rates[0].idx = index - IWL_FIRST_OFDM_RATE;830830+ } else {831831+ rs_sta->last_txrate_idx = index;830832 info->control.rates[0].idx = rs_sta->last_txrate_idx;833833+ }831834832835 IWL_DEBUG_RATE(priv, "leave: %d\n", index);833836}
···7777unsigned long pci_hotplug_io_size = DEFAULT_HOTPLUG_IO_SIZE;7878unsigned long pci_hotplug_mem_size = DEFAULT_HOTPLUG_MEM_SIZE;79798080-enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_PERFORMANCE;8080+enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_SAFE;81818282/*8383 * The default CLS is used if arch didn't set CLS explicitly and not
+24-23
drivers/pci/probe.c
···13511351 * will occur as normal.13521352 */13531353 if (dev->is_hotplug_bridge && (!list_is_singular(&dev->bus->devices) ||13541354- dev->bus->self->pcie_type != PCI_EXP_TYPE_ROOT_PORT))13541354+ (dev->bus->self &&13551355+ dev->bus->self->pcie_type != PCI_EXP_TYPE_ROOT_PORT)))13551356 *smpss = 0;1356135713571358 if (*smpss > dev->pcie_mpss)···1397139613981397static void pcie_write_mrrs(struct pci_dev *dev, int mps)13991398{14001400- int rc, mrrs;13991399+ int rc, mrrs, dev_mpss;1401140014021402- if (pcie_bus_config == PCIE_BUS_PERFORMANCE) {14031403- int dev_mpss = 128 << dev->pcie_mpss;14011401+ /* In the "safe" case, do not configure the MRRS. There appear to be14021402+ * issues with setting MRRS to 0 on a number of devices.14031403+ */1404140414051405- /* For Max performance, the MRRS must be set to the largest14061406- * supported value. However, it cannot be configured larger14071407- * than the MPS the device or the bus can support. This assumes14081408- * that the largest MRRS available on the device cannot be14091409- * smaller than the device MPSS.14101410- */14111411- mrrs = mps < dev_mpss ? mps : dev_mpss;14121412- } else14131413- /* In the "safe" case, configure the MRRS for fairness on the14141414- * bus by making all devices have the same size14151415- */14161416- mrrs = mps;14051405+ if (pcie_bus_config != PCIE_BUS_PERFORMANCE)14061406+ return;1417140714081408+ dev_mpss = 128 << dev->pcie_mpss;14091409+14101410+ /* For Max performance, the MRRS must be set to the largest supported14111411+ * value. However, it cannot be configured larger than the MPS the14121412+ * device or the bus can support. This assumes that the largest MRRS14131413+ * available on the device cannot be smaller than the device MPSS.14141414+ */14151415+ mrrs = min(mps, dev_mpss);1418141614191417 /* MRRS is a R/W register. Invalid values can be written, but a14201420- * subsiquent read will verify if the value is acceptable or not.14181418+ * subsequent read will verify if the value is acceptable or not.14211419 * If the MRRS value provided is not acceptable (e.g., too large),14221420 * shrink the value until it is acceptable to the HW.14231421 */14241422 while (mrrs != pcie_get_readrq(dev) && mrrs >= 128) {14231423+ dev_warn(&dev->dev, "Attempting to modify the PCI-E MRRS value"14241424+ " to %d. If any issues are encountered, please try "14251425+ "running with pci=pcie_bus_safe\n", mrrs);14251426 rc = pcie_set_readrq(dev, mrrs);14261427 if (rc)14271427- dev_err(&dev->dev, "Failed attempting to set the MRRS\n");14281428+ dev_err(&dev->dev,14291429+ "Failed attempting to set the MRRS\n");1428143014291431 mrrs /= 2;14301432 }···14401436 if (!pci_is_pcie(dev))14411437 return 0;1442143814431443- dev_info(&dev->dev, "Dev MPS %d MPSS %d MRRS %d\n",14391439+ dev_dbg(&dev->dev, "Dev MPS %d MPSS %d MRRS %d\n",14441440 pcie_get_mps(dev), 128<<dev->pcie_mpss, pcie_get_readrq(dev));1445144114461442 pcie_write_mps(dev, mps);14471443 pcie_write_mrrs(dev, mps);1448144414491449- dev_info(&dev->dev, "Dev MPS %d MPSS %d MRRS %d\n",14451445+ dev_dbg(&dev->dev, "Dev MPS %d MPSS %d MRRS %d\n",14501446 pcie_get_mps(dev), 128<<dev->pcie_mpss, pcie_get_readrq(dev));1451144714521448 return 0;···14591455void pcie_bus_configure_settings(struct pci_bus *bus, u8 mpss)14601456{14611457 u8 smpss = mpss;14621462-14631463- if (!bus->self)14641464- return;1465145814661459 if (!pci_is_pcie(bus->self))14671460 return;
···432432 u8 flogi_maddr[ETH_ALEN];433433 const struct net_device_ops *ops;434434435435+ rtnl_lock();436436+435437 /*436438 * Don't listen for Ethernet packets anymore.437439 * synchronize_net() ensures that the packet handlers are not running···462460 FCOE_NETDEV_DBG(netdev, "Failed to disable FCoE"463461 " specific feature for LLD.\n");464462 }463463+464464+ rtnl_unlock();465465466466 /* Release the self-reference taken during fcoe_interface_create() */467467 fcoe_interface_put(fcoe);···19551951 fcoe_if_destroy(port->lport);1956195219571953 /* Do not tear down the fcoe interface for NPIV port */19581958- if (!npiv) {19591959- rtnl_lock();19541954+ if (!npiv)19601955 fcoe_interface_cleanup(fcoe);19611961- rtnl_unlock();19621962- }1963195619641957 mutex_unlock(&fcoe_config_mutex);19651958}···20102009 printk(KERN_ERR "fcoe: Failed to create interface (%s)\n",20112010 netdev->name);20122011 rc = -EIO;20122012+ rtnl_unlock();20132013 fcoe_interface_cleanup(fcoe);20142014- goto out_nodev;20142014+ goto out_nortnl;20152015 }2016201620172017 /* Make this the "master" N_Port */···2029202720302028out_nodev:20312029 rtnl_unlock();20302030+out_nortnl:20322031 mutex_unlock(&fcoe_config_mutex);20332032 return rc;20342033}
+37-20
drivers/scsi/hpsa.c
···676676 BUG_ON(entry < 0 || entry >= HPSA_MAX_SCSI_DEVS_PER_HBA);677677 removed[*nremoved] = h->dev[entry];678678 (*nremoved)++;679679+680680+ /*681681+ * New physical devices won't have target/lun assigned yet682682+ * so we need to preserve the values in the slot we are replacing.683683+ */684684+ if (new_entry->target == -1) {685685+ new_entry->target = h->dev[entry]->target;686686+ new_entry->lun = h->dev[entry]->lun;687687+ }688688+679689 h->dev[entry] = new_entry;680690 added[*nadded] = new_entry;681691 (*nadded)++;···15581548}1559154915601550static int hpsa_update_device_info(struct ctlr_info *h,15611561- unsigned char scsi3addr[], struct hpsa_scsi_dev_t *this_device)15511551+ unsigned char scsi3addr[], struct hpsa_scsi_dev_t *this_device,15521552+ unsigned char *is_OBDR_device)15621553{15631563-#define OBDR_TAPE_INQ_SIZE 4915541554+15551555+#define OBDR_SIG_OFFSET 4315561556+#define OBDR_TAPE_SIG "$DR-10"15571557+#define OBDR_SIG_LEN (sizeof(OBDR_TAPE_SIG) - 1)15581558+#define OBDR_TAPE_INQ_SIZE (OBDR_SIG_OFFSET + OBDR_SIG_LEN)15591559+15641560 unsigned char *inq_buff;15611561+ unsigned char *obdr_sig;1565156215661563 inq_buff = kzalloc(OBDR_TAPE_INQ_SIZE, GFP_KERNEL);15671564 if (!inq_buff)···15991582 hpsa_get_raid_level(h, scsi3addr, &this_device->raid_level);16001583 else16011584 this_device->raid_level = RAID_UNKNOWN;15851585+15861586+ if (is_OBDR_device) {15871587+ /* See if this is a One-Button-Disaster-Recovery device15881588+ * by looking for "$DR-10" at offset 43 in inquiry data.15891589+ */15901590+ obdr_sig = &inq_buff[OBDR_SIG_OFFSET];15911591+ *is_OBDR_device = (this_device->devtype == TYPE_ROM &&15921592+ strncmp(obdr_sig, OBDR_TAPE_SIG,15931593+ OBDR_SIG_LEN) == 0);15941594+ }1602159516031596 kfree(inq_buff);16041597 return 0;···17431716 return 0;17441717 }1745171817461746- if (hpsa_update_device_info(h, scsi3addr, this_device))17191719+ if (hpsa_update_device_info(h, scsi3addr, this_device, NULL))17471720 return 0;17481721 (*nmsa2xxx_enclosures)++;17491722 hpsa_set_bus_target_lun(this_device, bus, target, 0);···18351808 */18361809 struct ReportLUNdata *physdev_list = NULL;18371810 struct ReportLUNdata *logdev_list = NULL;18381838- unsigned char *inq_buff = NULL;18391811 u32 nphysicals = 0;18401812 u32 nlogicals = 0;18411813 u32 ndev_allocated = 0;···18501824 GFP_KERNEL);18511825 physdev_list = kzalloc(reportlunsize, GFP_KERNEL);18521826 logdev_list = kzalloc(reportlunsize, GFP_KERNEL);18531853- inq_buff = kmalloc(OBDR_TAPE_INQ_SIZE, GFP_KERNEL);18541827 tmpdevice = kzalloc(sizeof(*tmpdevice), GFP_KERNEL);1855182818561856- if (!currentsd || !physdev_list || !logdev_list ||18571857- !inq_buff || !tmpdevice) {18291829+ if (!currentsd || !physdev_list || !logdev_list || !tmpdevice) {18581830 dev_err(&h->pdev->dev, "out of memory\n");18591831 goto out;18601832 }···18871863 /* adjust our table of devices */18881864 nmsa2xxx_enclosures = 0;18891865 for (i = 0; i < nphysicals + nlogicals + 1; i++) {18901890- u8 *lunaddrbytes;18661866+ u8 *lunaddrbytes, is_OBDR = 0;1891186718921868 /* Figure out where the LUN ID info is coming from */18931869 lunaddrbytes = figure_lunaddrbytes(h, raid_ctlr_position,···18981874 continue;1899187519001876 /* Get device type, vendor, model, device id */19011901- if (hpsa_update_device_info(h, lunaddrbytes, tmpdevice))18771877+ if (hpsa_update_device_info(h, lunaddrbytes, tmpdevice,18781878+ &is_OBDR))19021879 continue; /* skip it if we can't talk to it. */19031880 figure_bus_target_lun(h, lunaddrbytes, &bus, &target, &lun,19041881 tmpdevice);···19231898 hpsa_set_bus_target_lun(this_device, bus, target, lun);1924189919251900 switch (this_device->devtype) {19261926- case TYPE_ROM: {19011901+ case TYPE_ROM:19271902 /* We don't *really* support actual CD-ROM devices,19281903 * just "One Button Disaster Recovery" tape drive19291904 * which temporarily pretends to be a CD-ROM drive.···19311906 * device by checking for "$DR-10" in bytes 43-48 of19321907 * the inquiry data.19331908 */19341934- char obdr_sig[7];19351935-#define OBDR_TAPE_SIG "$DR-10"19361936- strncpy(obdr_sig, &inq_buff[43], 6);19371937- obdr_sig[6] = '\0';19381938- if (strncmp(obdr_sig, OBDR_TAPE_SIG, 6) != 0)19391939- /* Not OBDR device, ignore it. */19401940- break;19411941- }19421942- ncurrent++;19091909+ if (is_OBDR)19101910+ ncurrent++;19431911 break;19441912 case TYPE_DISK:19451913 if (i < nphysicals)···19651947 for (i = 0; i < ndev_allocated; i++)19661948 kfree(currentsd[i]);19671949 kfree(currentsd);19681968- kfree(inq_buff);19691950 kfree(physdev_list);19701951 kfree(logdev_list);19711952}
+12-1
drivers/scsi/isci/host.c
···531531 break;532532533533 case SCU_COMPLETION_TYPE_EVENT:534534+ sci_controller_event_completion(ihost, ent);535535+ break;536536+534537 case SCU_COMPLETION_TYPE_NOTIFY: {535538 event_cycle ^= ((event_get+1) & SCU_MAX_EVENTS) <<536539 (SMU_COMPLETION_QUEUE_GET_EVENT_CYCLE_BIT_SHIFT - SCU_MAX_EVENTS_SHIFT);···10941091 struct isci_request *request;10951092 struct isci_request *next_request;10961093 struct sas_task *task;10941094+ u16 active;1097109510981096 INIT_LIST_HEAD(&completed_request_list);10991097 INIT_LIST_HEAD(&errored_request_list);···11851181 }11861182 }1187118311841184+ /* the coalesence timeout doubles at each encoding step, so11851185+ * update it based on the ilog2 value of the outstanding requests11861186+ */11871187+ active = isci_tci_active(ihost);11881188+ writel(SMU_ICC_GEN_VAL(NUMBER, active) |11891189+ SMU_ICC_GEN_VAL(TIMER, ISCI_COALESCE_BASE + ilog2(active)),11901190+ &ihost->smu_registers->interrupt_coalesce_control);11881191}1189119211901193/**···14821471 struct isci_host *ihost = container_of(sm, typeof(*ihost), sm);1483147214841473 /* set the default interrupt coalescence number and timeout value. */14851485- sci_controller_set_interrupt_coalescence(ihost, 0x10, 250);14741474+ sci_controller_set_interrupt_coalescence(ihost, 0, 0);14861475}1487147614881477static void sci_controller_ready_state_exit(struct sci_base_state_machine *sm)
+3
drivers/scsi/isci/host.h
···369369#define ISCI_TAG_SEQ(tag) (((tag) >> 12) & (SCI_MAX_SEQ-1))370370#define ISCI_TAG_TCI(tag) ((tag) & (SCI_MAX_IO_REQUESTS-1))371371372372+/* interrupt coalescing baseline: 9 == 3 to 5us interrupt delay per command */373373+#define ISCI_COALESCE_BASE 9374374+372375/* expander attached sata devices require 3 rnc slots */373376static inline int sci_remote_device_node_count(struct isci_remote_device *idev)374377{
···104104 u32 parity_count = 0;105105 u32 llctl, link_rate;106106 u32 clksm_value = 0;107107+ u32 sp_timeouts = 0;107108108109 iphy->link_layer_registers = reg;109110···211210 }212211 llctl |= SCU_SAS_LLCTL_GEN_VAL(MAX_LINK_RATE, link_rate);213212 writel(llctl, &iphy->link_layer_registers->link_layer_control);213213+214214+ sp_timeouts = readl(&iphy->link_layer_registers->sas_phy_timeouts);215215+216216+ /* Clear the default 0x36 (54us) RATE_CHANGE timeout value. */217217+ sp_timeouts &= ~SCU_SAS_PHYTOV_GEN_VAL(RATE_CHANGE, 0xFF);218218+219219+ /* Set RATE_CHANGE timeout value to 0x3B (59us). This ensures SCU can220220+ * lock with 3Gb drive when SCU max rate is set to 1.5Gb.221221+ */222222+ sp_timeouts |= SCU_SAS_PHYTOV_GEN_VAL(RATE_CHANGE, 0x3B);223223+224224+ writel(sp_timeouts, &iphy->link_layer_registers->sas_phy_timeouts);214225215226 if (is_a2(ihost->pdev)) {216227 /* Program the max ARB time for the PHY to 700us so we inter-operate with
···732732 sci_change_state(&ireq->sm, SCI_REQ_ABORTING);733733 return SCI_SUCCESS;734734 case SCI_REQ_TASK_WAIT_TC_RESP:735735+ /* The task frame was already confirmed to have been736736+ * sent by the SCU HW. Since the state machine is737737+ * now only waiting for the task response itself,738738+ * abort the request and complete it immediately739739+ * and don't wait for the task response.740740+ */735741 sci_change_state(&ireq->sm, SCI_REQ_ABORTING);736742 sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);737743 return SCI_SUCCESS;738744 case SCI_REQ_ABORTING:739739- sci_change_state(&ireq->sm, SCI_REQ_COMPLETED);740740- return SCI_SUCCESS;745745+ /* If a request has a termination requested twice, return746746+ * a failure indication, since HW confirmation of the first747747+ * abort is still outstanding.748748+ */741749 case SCI_REQ_COMPLETED:742750 default:743751 dev_warn(&ireq->owning_controller->pdev->dev,···24072399 }24082400}2409240124102410-static void isci_request_process_stp_response(struct sas_task *task,24112411- void *response_buffer)24022402+static void isci_process_stp_response(struct sas_task *task, struct dev_to_host_fis *fis)24122403{24132413- struct dev_to_host_fis *d2h_reg_fis = response_buffer;24142404 struct task_status_struct *ts = &task->task_status;24152405 struct ata_task_resp *resp = (void *)&ts->buf[0];2416240624172417- resp->frame_len = le16_to_cpu(*(__le16 *)(response_buffer + 6));24182418- memcpy(&resp->ending_fis[0], response_buffer + 16, 24);24072407+ resp->frame_len = sizeof(*fis);24082408+ memcpy(resp->ending_fis, fis, sizeof(*fis));24192409 ts->buf_valid_size = sizeof(*resp);2420241024212421- /**24222422- * If the device fault bit is set in the status register, then24112411+ /* If the device fault bit is set in the status register, then24232412 * set the sense data and return.24242413 */24252425- if (d2h_reg_fis->status & ATA_DF)24142414+ if (fis->status & ATA_DF)24262415 ts->stat = SAS_PROTO_RESPONSE;24272416 else24282417 ts->stat = SAM_STAT_GOOD;···24332428{24342429 struct sas_task *task = isci_request_access_task(request);24352430 struct ssp_response_iu *resp_iu;24362436- void *resp_buf;24372431 unsigned long task_flags;24382432 struct isci_remote_device *idev = isci_lookup_device(task->dev);24392433 enum service_response response = SAS_TASK_UNDELIVERED;···25692565 task);2570256625712567 if (sas_protocol_ata(task->task_proto)) {25722572- resp_buf = &request->stp.rsp;25732573- isci_request_process_stp_response(task,25742574- resp_buf);25682568+ isci_process_stp_response(task, &request->stp.rsp);25752569 } else if (SAS_PROTOCOL_SSP == task->task_proto) {2576257025772571 /* crack the iu response buffer. */
+1-1
drivers/scsi/isci/unsolicited_frame_control.c
···7272 */7373 buf_len = SCU_MAX_UNSOLICITED_FRAMES * SCU_UNSOLICITED_FRAME_BUFFER_SIZE;7474 header_len = SCU_MAX_UNSOLICITED_FRAMES * sizeof(struct scu_unsolicited_frame_header);7575- size = buf_len + header_len + SCU_MAX_UNSOLICITED_FRAMES * sizeof(dma_addr_t);7575+ size = buf_len + header_len + SCU_MAX_UNSOLICITED_FRAMES * sizeof(uf_control->address_table.array[0]);76767777 /*7878 * The Unsolicited Frame buffers are set at the start of the UF
+1-1
drivers/scsi/isci/unsolicited_frame_control.h
···214214 * starting address of the UF address table.215215 * 64-bit pointers are required by the hardware.216216 */217217- dma_addr_t *array;217217+ u64 *array;218218219219 /**220220 * This field specifies the physical address location for the UF
+41-18
drivers/scsi/libfc/fc_exch.c
···494494 */495495 error = lport->tt.frame_send(lport, fp);496496497497+ if (fh->fh_type == FC_TYPE_BLS)498498+ return error;499499+497500 /*498501 * Update the exchange and sequence flags,499502 * assuming all frames for the sequence have been sent.···578575}579576580577/**581581- * fc_seq_exch_abort() - Abort an exchange and sequence582582- * @req_sp: The sequence to be aborted578578+ * fc_exch_abort_locked() - Abort an exchange579579+ * @ep: The exchange to be aborted583580 * @timer_msec: The period of time to wait before aborting584581 *585585- * Generally called because of a timeout or an abort from the upper layer.582582+ * Locking notes: Called with exch lock held583583+ *584584+ * Return value: 0 on success else error code586585 */587587-static int fc_seq_exch_abort(const struct fc_seq *req_sp,588588- unsigned int timer_msec)586586+static int fc_exch_abort_locked(struct fc_exch *ep,587587+ unsigned int timer_msec)589588{590589 struct fc_seq *sp;591591- struct fc_exch *ep;592590 struct fc_frame *fp;593591 int error;594592595595- ep = fc_seq_exch(req_sp);596596-597597- spin_lock_bh(&ep->ex_lock);598593 if (ep->esb_stat & (ESB_ST_COMPLETE | ESB_ST_ABNORMAL) ||599599- ep->state & (FC_EX_DONE | FC_EX_RST_CLEANUP)) {600600- spin_unlock_bh(&ep->ex_lock);594594+ ep->state & (FC_EX_DONE | FC_EX_RST_CLEANUP))601595 return -ENXIO;602602- }603596604597 /*605598 * Send the abort on a new sequence if possible.606599 */607600 sp = fc_seq_start_next_locked(&ep->seq);608608- if (!sp) {609609- spin_unlock_bh(&ep->ex_lock);601601+ if (!sp)610602 return -ENOMEM;611611- }612603613604 ep->esb_stat |= ESB_ST_SEQ_INIT | ESB_ST_ABNORMAL;614605 if (timer_msec)615606 fc_exch_timer_set_locked(ep, timer_msec);616616- spin_unlock_bh(&ep->ex_lock);617607618608 /*619609 * If not logged into the fabric, don't send ABTS but leave···625629 error = fc_seq_send(ep->lp, sp, fp);626630 } else627631 error = -ENOBUFS;632632+ return error;633633+}634634+635635+/**636636+ * fc_seq_exch_abort() - Abort an exchange and sequence637637+ * @req_sp: The sequence to be aborted638638+ * @timer_msec: The period of time to wait before aborting639639+ *640640+ * Generally called because of a timeout or an abort from the upper layer.641641+ *642642+ * Return value: 0 on success else error code643643+ */644644+static int fc_seq_exch_abort(const struct fc_seq *req_sp,645645+ unsigned int timer_msec)646646+{647647+ struct fc_exch *ep;648648+ int error;649649+650650+ ep = fc_seq_exch(req_sp);651651+ spin_lock_bh(&ep->ex_lock);652652+ error = fc_exch_abort_locked(ep, timer_msec);653653+ spin_unlock_bh(&ep->ex_lock);628654 return error;629655}630656···17331715 int rc = 1;1734171617351717 spin_lock_bh(&ep->ex_lock);17181718+ fc_exch_abort_locked(ep, 0);17361719 ep->state |= FC_EX_RST_CLEANUP;17371720 if (cancel_delayed_work(&ep->timeout_work))17381721 atomic_dec(&ep->ex_refcnt); /* drop hold for timer */···19811962 struct fc_exch *ep;19821963 struct fc_seq *sp = NULL;19831964 struct fc_frame_header *fh;19651965+ struct fc_fcp_pkt *fsp = NULL;19841966 int rc = 1;1985196719861968 ep = fc_exch_alloc(lport, fp);···20041984 fc_exch_setup_hdr(ep, fp, ep->f_ctl);20051985 sp->cnt++;2006198620072007- if (ep->xid <= lport->lro_xid && fh->fh_r_ctl == FC_RCTL_DD_UNSOL_CMD)19871987+ if (ep->xid <= lport->lro_xid && fh->fh_r_ctl == FC_RCTL_DD_UNSOL_CMD) {19881988+ fsp = fr_fsp(fp);20081989 fc_fcp_ddp_setup(fr_fsp(fp), ep->xid);19901990+ }2009199120101992 if (unlikely(lport->tt.frame_send(lport, fp)))20111993 goto err;···20211999 spin_unlock_bh(&ep->ex_lock);20222000 return sp;20232001err:20242024- fc_fcp_ddp_done(fr_fsp(fp));20022002+ if (fsp)20032003+ fc_fcp_ddp_done(fsp);20252004 rc = fc_exch_done_locked(ep);20262005 spin_unlock_bh(&ep->ex_lock);20272006 if (!rc)
+9-2
drivers/scsi/libfc/fc_fcp.c
···20192019 struct fc_fcp_internal *si;20202020 int rc = FAILED;20212021 unsigned long flags;20222022+ int rval;20232023+20242024+ rval = fc_block_scsi_eh(sc_cmd);20252025+ if (rval)20262026+ return rval;2022202720232028 lport = shost_priv(sc_cmd->device->host);20242029 if (lport->state != LPORT_ST_READY)···20732068 int rc = FAILED;20742069 int rval;2075207020762076- rval = fc_remote_port_chkready(rport);20712071+ rval = fc_block_scsi_eh(sc_cmd);20772072 if (rval)20782078- goto out;20732073+ return rval;2079207420802075 lport = shost_priv(sc_cmd->device->host);20812076···21202115 unsigned long wait_tmo;2121211621222117 FC_SCSI_DBG(lport, "Resetting host\n");21182118+21192119+ fc_block_scsi_eh(sc_cmd);2123212021242121 lport->tt.lport_reset(lport);21252122 wait_tmo = jiffies + FC_HOST_RESET_TIMEOUT;
+10-1
drivers/scsi/libfc/fc_lport.c
···8888 */89899090#include <linux/timer.h>9191+#include <linux/delay.h>9192#include <linux/slab.h>9293#include <asm/unaligned.h>9394···10301029 FCH_EVT_LIPRESET, 0);10311030 fc_vports_linkchange(lport);10321031 fc_lport_reset_locked(lport);10331033- if (lport->link_up)10321032+ if (lport->link_up) {10331033+ /*10341034+ * Wait upto resource allocation time out before10351035+ * doing re-login since incomplete FIP exchanged10361036+ * from last session may collide with exchanges10371037+ * in new session.10381038+ */10391039+ msleep(lport->r_a_tov);10341040 fc_lport_enter_flogi(lport);10411041+ }10351042}1036104310371044/**
+5-2
drivers/scsi/qla2xxx/qla_attr.c
···17861786 fc_vport_set_state(fc_vport, FC_VPORT_LINKDOWN);17871787 }1788178817891789- if ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && ql2xenabledif) {17891789+ if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) {17901790 if (ha->fw_attributes & BIT_4) {17911791+ int prot = 0;17911792 vha->flags.difdix_supported = 1;17921793 ql_dbg(ql_dbg_user, vha, 0x7082,17931794 "Registered for DIF/DIX type 1 and 3 protection.\n");17951795+ if (ql2xenabledif == 1)17961796+ prot = SHOST_DIX_TYPE0_PROTECTION;17941797 scsi_host_set_prot(vha->host,17951795- SHOST_DIF_TYPE1_PROTECTION17981798+ prot | SHOST_DIF_TYPE1_PROTECTION17961799 | SHOST_DIF_TYPE2_PROTECTION17971800 | SHOST_DIF_TYPE3_PROTECTION17981801 | SHOST_DIX_TYPE1_PROTECTION
+18-18
drivers/scsi/qla2xxx/qla_dbg.c
···88/*99 * Table for showing the current message id in use for particular level1010 * Change this table for addition of log/debug messages.1111- * -----------------------------------------------------1212- * | Level | Last Value Used |1313- * -----------------------------------------------------1414- * | Module Init and Probe | 0x0116 |1515- * | Mailbox commands | 0x111e |1616- * | Device Discovery | 0x2083 |1717- * | Queue Command and IO tracing | 0x302e |1818- * | DPC Thread | 0x401c |1919- * | Async Events | 0x5059 |2020- * | Timer Routines | 0x600d |2121- * | User Space Interactions | 0x709c |2222- * | Task Management | 0x8043 |2323- * | AER/EEH | 0x900f |2424- * | Virtual Port | 0xa007 |2525- * | ISP82XX Specific | 0xb027 |2626- * | MultiQ | 0xc00b |2727- * | Misc | 0xd00b |2828- * -----------------------------------------------------1111+ * ----------------------------------------------------------------------1212+ * | Level | Last Value Used | Holes |1313+ * ----------------------------------------------------------------------1414+ * | Module Init and Probe | 0x0116 | |1515+ * | Mailbox commands | 0x1126 | |1616+ * | Device Discovery | 0x2083 | |1717+ * | Queue Command and IO tracing | 0x302e | 0x3008 |1818+ * | DPC Thread | 0x401c | |1919+ * | Async Events | 0x5059 | |2020+ * | Timer Routines | 0x600d | |2121+ * | User Space Interactions | 0x709d | |2222+ * | Task Management | 0x8041 | |2323+ * | AER/EEH | 0x900f | |2424+ * | Virtual Port | 0xa007 | |2525+ * | ISP82XX Specific | 0xb04f | |2626+ * | MultiQ | 0xc00b | |2727+ * | Misc | 0xd00b | |2828+ * ----------------------------------------------------------------------2929 */30303131#include "qla_def.h"
···537537 /*538538 * If DIF Error is set in comp_status, these additional fields are539539 * defined:540540+ *541541+ * !!! NOTE: Firmware sends expected/actual DIF data in big endian542542+ * format; but all of the "data" field gets swab32-d in the beginning543543+ * of qla2x00_status_entry().544544+ *540545 * &data[10] : uint8_t report_runt_bg[2]; - computed guard541546 * &data[12] : uint8_t actual_dif[8]; - DIF Data received542547 * &data[20] : uint8_t expected_dif[8]; - DIF Data computed
-3
drivers/scsi/qla2xxx/qla_init.c
···38383838 req = vha->req;38393839 rsp = req->rsp;3840384038413841- atomic_set(&vha->loop_state, LOOP_UPDATE);38423841 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags);38433842 if (vha->flags.online) {38443843 if (!(rval = qla2x00_fw_ready(vha))) {38453844 /* Wait at most MAX_TARGET RSCNs for a stable link. */38463845 wait_time = 256;38473846 do {38483848- atomic_set(&vha->loop_state, LOOP_UPDATE);38493849-38503847 /* Issue a marker after FW becomes ready. */38513848 qla2x00_marker(vha, req, rsp, 0, 0,38523849 MK_SYNC_ALL);
+29
drivers/scsi/qla2xxx/qla_inline.h
···102102 fcport->d_id.b.al_pa);103103 }104104}105105+106106+static inline int107107+qla2x00_hba_err_chk_enabled(srb_t *sp)108108+{109109+ /*110110+ * Uncomment when corresponding SCSI changes are done.111111+ *112112+ if (!sp->cmd->prot_chk)113113+ return 0;114114+ *115115+ */116116+117117+ switch (scsi_get_prot_op(sp->cmd)) {118118+ case SCSI_PROT_READ_STRIP:119119+ case SCSI_PROT_WRITE_INSERT:120120+ if (ql2xenablehba_err_chk >= 1)121121+ return 1;122122+ break;123123+ case SCSI_PROT_READ_PASS:124124+ case SCSI_PROT_WRITE_PASS:125125+ if (ql2xenablehba_err_chk >= 2)126126+ return 1;127127+ break;128128+ case SCSI_PROT_READ_INSERT:129129+ case SCSI_PROT_WRITE_STRIP:130130+ return 1;131131+ }132132+ return 0;133133+}
+235-47
drivers/scsi/qla2xxx/qla_iocb.c
···709709 *710710 */711711static inline void712712-qla24xx_set_t10dif_tags(struct scsi_cmnd *cmd, struct fw_dif_context *pkt,712712+qla24xx_set_t10dif_tags(srb_t *sp, struct fw_dif_context *pkt,713713 unsigned int protcnt)714714{715715- struct sd_dif_tuple *spt;715715+ struct scsi_cmnd *cmd = sp->cmd;716716 scsi_qla_host_t *vha = shost_priv(cmd->device->host);717717- unsigned char op = scsi_get_prot_op(cmd);718717719718 switch (scsi_get_prot_type(cmd)) {720720- /* For TYPE 0 protection: no checking */721719 case SCSI_PROT_DIF_TYPE0:722722- pkt->ref_tag_mask[0] = 0x00;723723- pkt->ref_tag_mask[1] = 0x00;724724- pkt->ref_tag_mask[2] = 0x00;725725- pkt->ref_tag_mask[3] = 0x00;720720+ /*721721+ * No check for ql2xenablehba_err_chk, as it would be an722722+ * I/O error if hba tag generation is not done.723723+ */724724+ pkt->ref_tag = cpu_to_le32((uint32_t)725725+ (0xffffffff & scsi_get_lba(cmd)));726726+727727+ if (!qla2x00_hba_err_chk_enabled(sp))728728+ break;729729+730730+ pkt->ref_tag_mask[0] = 0xff;731731+ pkt->ref_tag_mask[1] = 0xff;732732+ pkt->ref_tag_mask[2] = 0xff;733733+ pkt->ref_tag_mask[3] = 0xff;726734 break;727735728736 /*···738730 * match LBA in CDB + N739731 */740732 case SCSI_PROT_DIF_TYPE2:741741- if (!ql2xenablehba_err_chk)742742- break;743743-744744- if (scsi_prot_sg_count(cmd)) {745745- spt = page_address(sg_page(scsi_prot_sglist(cmd))) +746746- scsi_prot_sglist(cmd)[0].offset;747747- pkt->app_tag = swab32(spt->app_tag);748748- pkt->app_tag_mask[0] = 0xff;749749- pkt->app_tag_mask[1] = 0xff;750750- }733733+ pkt->app_tag = __constant_cpu_to_le16(0);734734+ pkt->app_tag_mask[0] = 0x0;735735+ pkt->app_tag_mask[1] = 0x0;751736752737 pkt->ref_tag = cpu_to_le32((uint32_t)753738 (0xffffffff & scsi_get_lba(cmd)));739739+740740+ if (!qla2x00_hba_err_chk_enabled(sp))741741+ break;754742755743 /* enable ALL bytes of the ref tag */756744 pkt->ref_tag_mask[0] = 0xff;···767763 * 16 bit app tag.768764 */769765 case SCSI_PROT_DIF_TYPE1:770770- if (!ql2xenablehba_err_chk)766766+ pkt->ref_tag = cpu_to_le32((uint32_t)767767+ (0xffffffff & scsi_get_lba(cmd)));768768+ pkt->app_tag = __constant_cpu_to_le16(0);769769+ pkt->app_tag_mask[0] = 0x0;770770+ pkt->app_tag_mask[1] = 0x0;771771+772772+ if (!qla2x00_hba_err_chk_enabled(sp))771773 break;772774773773- if (protcnt && (op == SCSI_PROT_WRITE_STRIP ||774774- op == SCSI_PROT_WRITE_PASS)) {775775- spt = page_address(sg_page(scsi_prot_sglist(cmd))) +776776- scsi_prot_sglist(cmd)[0].offset;777777- ql_dbg(ql_dbg_io, vha, 0x3008,778778- "LBA from user %p, lba = 0x%x for cmd=%p.\n",779779- spt, (int)spt->ref_tag, cmd);780780- pkt->ref_tag = swab32(spt->ref_tag);781781- pkt->app_tag_mask[0] = 0x0;782782- pkt->app_tag_mask[1] = 0x0;783783- } else {784784- pkt->ref_tag = cpu_to_le32((uint32_t)785785- (0xffffffff & scsi_get_lba(cmd)));786786- pkt->app_tag = __constant_cpu_to_le16(0);787787- pkt->app_tag_mask[0] = 0x0;788788- pkt->app_tag_mask[1] = 0x0;789789- }790775 /* enable ALL bytes of the ref tag */791776 pkt->ref_tag_mask[0] = 0xff;792777 pkt->ref_tag_mask[1] = 0xff;···791798 scsi_get_prot_type(cmd), cmd);792799}793800801801+struct qla2_sgx {802802+ dma_addr_t dma_addr; /* OUT */803803+ uint32_t dma_len; /* OUT */794804805805+ uint32_t tot_bytes; /* IN */806806+ struct scatterlist *cur_sg; /* IN */807807+808808+ /* for book keeping, bzero on initial invocation */809809+ uint32_t bytes_consumed;810810+ uint32_t num_bytes;811811+ uint32_t tot_partial;812812+813813+ /* for debugging */814814+ uint32_t num_sg;815815+ srb_t *sp;816816+};817817+818818+static int819819+qla24xx_get_one_block_sg(uint32_t blk_sz, struct qla2_sgx *sgx,820820+ uint32_t *partial)821821+{822822+ struct scatterlist *sg;823823+ uint32_t cumulative_partial, sg_len;824824+ dma_addr_t sg_dma_addr;825825+826826+ if (sgx->num_bytes == sgx->tot_bytes)827827+ return 0;828828+829829+ sg = sgx->cur_sg;830830+ cumulative_partial = sgx->tot_partial;831831+832832+ sg_dma_addr = sg_dma_address(sg);833833+ sg_len = sg_dma_len(sg);834834+835835+ sgx->dma_addr = sg_dma_addr + sgx->bytes_consumed;836836+837837+ if ((cumulative_partial + (sg_len - sgx->bytes_consumed)) >= blk_sz) {838838+ sgx->dma_len = (blk_sz - cumulative_partial);839839+ sgx->tot_partial = 0;840840+ sgx->num_bytes += blk_sz;841841+ *partial = 0;842842+ } else {843843+ sgx->dma_len = sg_len - sgx->bytes_consumed;844844+ sgx->tot_partial += sgx->dma_len;845845+ *partial = 1;846846+ }847847+848848+ sgx->bytes_consumed += sgx->dma_len;849849+850850+ if (sg_len == sgx->bytes_consumed) {851851+ sg = sg_next(sg);852852+ sgx->num_sg++;853853+ sgx->cur_sg = sg;854854+ sgx->bytes_consumed = 0;855855+ }856856+857857+ return 1;858858+}859859+860860+static int861861+qla24xx_walk_and_build_sglist_no_difb(struct qla_hw_data *ha, srb_t *sp,862862+ uint32_t *dsd, uint16_t tot_dsds)863863+{864864+ void *next_dsd;865865+ uint8_t avail_dsds = 0;866866+ uint32_t dsd_list_len;867867+ struct dsd_dma *dsd_ptr;868868+ struct scatterlist *sg_prot;869869+ uint32_t *cur_dsd = dsd;870870+ uint16_t used_dsds = tot_dsds;871871+872872+ uint32_t prot_int;873873+ uint32_t partial;874874+ struct qla2_sgx sgx;875875+ dma_addr_t sle_dma;876876+ uint32_t sle_dma_len, tot_prot_dma_len = 0;877877+ struct scsi_cmnd *cmd = sp->cmd;878878+879879+ prot_int = cmd->device->sector_size;880880+881881+ memset(&sgx, 0, sizeof(struct qla2_sgx));882882+ sgx.tot_bytes = scsi_bufflen(sp->cmd);883883+ sgx.cur_sg = scsi_sglist(sp->cmd);884884+ sgx.sp = sp;885885+886886+ sg_prot = scsi_prot_sglist(sp->cmd);887887+888888+ while (qla24xx_get_one_block_sg(prot_int, &sgx, &partial)) {889889+890890+ sle_dma = sgx.dma_addr;891891+ sle_dma_len = sgx.dma_len;892892+alloc_and_fill:893893+ /* Allocate additional continuation packets? */894894+ if (avail_dsds == 0) {895895+ avail_dsds = (used_dsds > QLA_DSDS_PER_IOCB) ?896896+ QLA_DSDS_PER_IOCB : used_dsds;897897+ dsd_list_len = (avail_dsds + 1) * 12;898898+ used_dsds -= avail_dsds;899899+900900+ /* allocate tracking DS */901901+ dsd_ptr = kzalloc(sizeof(struct dsd_dma), GFP_ATOMIC);902902+ if (!dsd_ptr)903903+ return 1;904904+905905+ /* allocate new list */906906+ dsd_ptr->dsd_addr = next_dsd =907907+ dma_pool_alloc(ha->dl_dma_pool, GFP_ATOMIC,908908+ &dsd_ptr->dsd_list_dma);909909+910910+ if (!next_dsd) {911911+ /*912912+ * Need to cleanup only this dsd_ptr, rest913913+ * will be done by sp_free_dma()914914+ */915915+ kfree(dsd_ptr);916916+ return 1;917917+ }918918+919919+ list_add_tail(&dsd_ptr->list,920920+ &((struct crc_context *)sp->ctx)->dsd_list);921921+922922+ sp->flags |= SRB_CRC_CTX_DSD_VALID;923923+924924+ /* add new list to cmd iocb or last list */925925+ *cur_dsd++ = cpu_to_le32(LSD(dsd_ptr->dsd_list_dma));926926+ *cur_dsd++ = cpu_to_le32(MSD(dsd_ptr->dsd_list_dma));927927+ *cur_dsd++ = dsd_list_len;928928+ cur_dsd = (uint32_t *)next_dsd;929929+ }930930+ *cur_dsd++ = cpu_to_le32(LSD(sle_dma));931931+ *cur_dsd++ = cpu_to_le32(MSD(sle_dma));932932+ *cur_dsd++ = cpu_to_le32(sle_dma_len);933933+ avail_dsds--;934934+935935+ if (partial == 0) {936936+ /* Got a full protection interval */937937+ sle_dma = sg_dma_address(sg_prot) + tot_prot_dma_len;938938+ sle_dma_len = 8;939939+940940+ tot_prot_dma_len += sle_dma_len;941941+ if (tot_prot_dma_len == sg_dma_len(sg_prot)) {942942+ tot_prot_dma_len = 0;943943+ sg_prot = sg_next(sg_prot);944944+ }945945+946946+ partial = 1; /* So as to not re-enter this block */947947+ goto alloc_and_fill;948948+ }949949+ }950950+ /* Null termination */951951+ *cur_dsd++ = 0;952952+ *cur_dsd++ = 0;953953+ *cur_dsd++ = 0;954954+ return 0;955955+}795956static int796957qla24xx_walk_and_build_sglist(struct qla_hw_data *ha, srb_t *sp, uint32_t *dsd,797958 uint16_t tot_dsds)···1128981 struct scsi_cmnd *cmd;1129982 struct scatterlist *cur_seg;1130983 int sgc;11311131- uint32_t total_bytes;984984+ uint32_t total_bytes = 0;1132985 uint32_t data_bytes;1133986 uint32_t dif_bytes;1134987 uint8_t bundling = 1;···11701023 __constant_cpu_to_le16(CF_READ_DATA);11711024 }1172102511731173- tot_prot_dsds = scsi_prot_sg_count(cmd);11741174- if (!tot_prot_dsds)10261026+ if ((scsi_get_prot_op(sp->cmd) == SCSI_PROT_READ_INSERT) ||10271027+ (scsi_get_prot_op(sp->cmd) == SCSI_PROT_WRITE_STRIP) ||10281028+ (scsi_get_prot_op(sp->cmd) == SCSI_PROT_READ_STRIP) ||10291029+ (scsi_get_prot_op(sp->cmd) == SCSI_PROT_WRITE_INSERT))11751030 bundling = 0;1176103111771032 /* Allocate CRC context from global pool */···1196104711971048 INIT_LIST_HEAD(&crc_ctx_pkt->dsd_list);1198104911991199- qla24xx_set_t10dif_tags(cmd, (struct fw_dif_context *)10501050+ qla24xx_set_t10dif_tags(sp, (struct fw_dif_context *)12001051 &crc_ctx_pkt->ref_tag, tot_prot_dsds);1201105212021053 cmd_pkt->crc_context_address[0] = cpu_to_le32(LSD(crc_ctx_dma));···12251076 fcp_cmnd->additional_cdb_len |= 2;1226107712271078 int_to_scsilun(sp->cmd->device->lun, &fcp_cmnd->lun);12281228- host_to_fcp_swap((uint8_t *)&fcp_cmnd->lun, sizeof(fcp_cmnd->lun));12291079 memcpy(fcp_cmnd->cdb, cmd->cmnd, cmd->cmd_len);12301080 cmd_pkt->fcp_cmnd_dseg_len = cpu_to_le16(fcp_cmnd_len);12311081 cmd_pkt->fcp_cmnd_dseg_address[0] = cpu_to_le32(···12551107 cmd_pkt->fcp_rsp_dseg_len = 0; /* Let response come in status iocb */1256110812571109 /* Compute dif len and adjust data len to incude protection */12581258- total_bytes = data_bytes;12591110 dif_bytes = 0;12601111 blk_size = cmd->device->sector_size;12611261- if (scsi_get_prot_op(cmd) != SCSI_PROT_NORMAL) {12621262- dif_bytes = (data_bytes / blk_size) * 8;12631263- total_bytes += dif_bytes;11121112+ dif_bytes = (data_bytes / blk_size) * 8;11131113+11141114+ switch (scsi_get_prot_op(sp->cmd)) {11151115+ case SCSI_PROT_READ_INSERT:11161116+ case SCSI_PROT_WRITE_STRIP:11171117+ total_bytes = data_bytes;11181118+ data_bytes += dif_bytes;11191119+ break;11201120+11211121+ case SCSI_PROT_READ_STRIP:11221122+ case SCSI_PROT_WRITE_INSERT:11231123+ case SCSI_PROT_READ_PASS:11241124+ case SCSI_PROT_WRITE_PASS:11251125+ total_bytes = data_bytes + dif_bytes;11261126+ break;11271127+ default:11281128+ BUG();12641129 }1265113012661266- if (!ql2xenablehba_err_chk)11311131+ if (!qla2x00_hba_err_chk_enabled(sp))12671132 fw_prot_opts |= 0x10; /* Disable Guard tag checking */1268113312691134 if (!bundling) {···1312115113131152 cmd_pkt->control_flags |=13141153 __constant_cpu_to_le16(CF_DATA_SEG_DESCR_ENABLE);13151315- if (qla24xx_walk_and_build_sglist(ha, sp, cur_dsd,11541154+11551155+ if (!bundling && tot_prot_dsds) {11561156+ if (qla24xx_walk_and_build_sglist_no_difb(ha, sp,11571157+ cur_dsd, tot_dsds))11581158+ goto crc_queuing_error;11591159+ } else if (qla24xx_walk_and_build_sglist(ha, sp, cur_dsd,13161160 (tot_dsds - tot_prot_dsds)))13171161 goto crc_queuing_error;13181162···15801414 goto queuing_error;15811415 else15821416 sp->flags |= SRB_DMA_VALID;14171417+14181418+ if ((scsi_get_prot_op(cmd) == SCSI_PROT_READ_INSERT) ||14191419+ (scsi_get_prot_op(cmd) == SCSI_PROT_WRITE_STRIP)) {14201420+ struct qla2_sgx sgx;14211421+ uint32_t partial;14221422+14231423+ memset(&sgx, 0, sizeof(struct qla2_sgx));14241424+ sgx.tot_bytes = scsi_bufflen(cmd);14251425+ sgx.cur_sg = scsi_sglist(cmd);14261426+ sgx.sp = sp;14271427+14281428+ nseg = 0;14291429+ while (qla24xx_get_one_block_sg(14301430+ cmd->device->sector_size, &sgx, &partial))14311431+ nseg++;14321432+ }15831433 } else15841434 nseg = 0;15851435···16101428 goto queuing_error;16111429 else16121430 sp->flags |= SRB_CRC_PROT_DMA_VALID;14311431+14321432+ if ((scsi_get_prot_op(cmd) == SCSI_PROT_READ_INSERT) ||14331433+ (scsi_get_prot_op(cmd) == SCSI_PROT_WRITE_STRIP)) {14341434+ nseg = scsi_bufflen(cmd) / cmd->device->sector_size;14351435+ }16131436 } else {16141437 nseg = 0;16151438 }···16411454 /* Build header part of command packet (excluding the OPCODE). */16421455 req->current_outstanding_cmd = handle;16431456 req->outstanding_cmds[handle] = sp;14571457+ sp->handle = handle;16441458 sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle;16451459 req->cnt -= req_cnt;16461460
+87-28
drivers/scsi/qla2xxx/qla_isr.c
···719719 vha->flags.rscn_queue_overflow = 1;720720 }721721722722- atomic_set(&vha->loop_state, LOOP_UPDATE);723722 atomic_set(&vha->loop_down_timer, 0);724723 vha->flags.management_server_logged_in = 0;725724···14341435 * ASC/ASCQ fields in the sense buffer with ILLEGAL_REQUEST14351436 * to indicate to the kernel that the HBA detected error.14361437 */14371437-static inline void14381438+static inline int14381439qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)14391440{14401441 struct scsi_qla_host *vha = sp->fcport->vha;14411442 struct scsi_cmnd *cmd = sp->cmd;14421442- struct scsi_dif_tuple *ep =14431443- (struct scsi_dif_tuple *)&sts24->data[20];14441444- struct scsi_dif_tuple *ap =14451445- (struct scsi_dif_tuple *)&sts24->data[12];14431443+ uint8_t *ap = &sts24->data[12];14441444+ uint8_t *ep = &sts24->data[20];14461445 uint32_t e_ref_tag, a_ref_tag;14471446 uint16_t e_app_tag, a_app_tag;14481447 uint16_t e_guard, a_guard;1449144814501450- e_ref_tag = be32_to_cpu(ep->ref_tag);14511451- a_ref_tag = be32_to_cpu(ap->ref_tag);14521452- e_app_tag = be16_to_cpu(ep->app_tag);14531453- a_app_tag = be16_to_cpu(ap->app_tag);14541454- e_guard = be16_to_cpu(ep->guard);14551455- a_guard = be16_to_cpu(ap->guard);14491449+ /*14501450+ * swab32 of the "data" field in the beginning of qla2x00_status_entry()14511451+ * would make guard field appear at offset 214521452+ */14531453+ a_guard = le16_to_cpu(*(uint16_t *)(ap + 2));14541454+ a_app_tag = le16_to_cpu(*(uint16_t *)(ap + 0));14551455+ a_ref_tag = le32_to_cpu(*(uint32_t *)(ap + 4));14561456+ e_guard = le16_to_cpu(*(uint16_t *)(ep + 2));14571457+ e_app_tag = le16_to_cpu(*(uint16_t *)(ep + 0));14581458+ e_ref_tag = le32_to_cpu(*(uint32_t *)(ep + 4));1456145914571460 ql_dbg(ql_dbg_io, vha, 0x3023,14581461 "iocb(s) %p Returned STATUS.\n", sts24);···14661465 cmd->cmnd[0], (u64)scsi_get_lba(cmd), a_ref_tag, e_ref_tag,14671466 a_app_tag, e_app_tag, a_guard, e_guard);1468146714681468+ /*14691469+ * Ignore sector if:14701470+ * For type 3: ref & app tag is all 'f's14711471+ * For type 0,1,2: app tag is all 'f's14721472+ */14731473+ if ((a_app_tag == 0xffff) &&14741474+ ((scsi_get_prot_type(cmd) != SCSI_PROT_DIF_TYPE3) ||14751475+ (a_ref_tag == 0xffffffff))) {14761476+ uint32_t blocks_done, resid;14771477+ sector_t lba_s = scsi_get_lba(cmd);14781478+14791479+ /* 2TB boundary case covered automatically with this */14801480+ blocks_done = e_ref_tag - (uint32_t)lba_s + 1;14811481+14821482+ resid = scsi_bufflen(cmd) - (blocks_done *14831483+ cmd->device->sector_size);14841484+14851485+ scsi_set_resid(cmd, resid);14861486+ cmd->result = DID_OK << 16;14871487+14881488+ /* Update protection tag */14891489+ if (scsi_prot_sg_count(cmd)) {14901490+ uint32_t i, j = 0, k = 0, num_ent;14911491+ struct scatterlist *sg;14921492+ struct sd_dif_tuple *spt;14931493+14941494+ /* Patch the corresponding protection tags */14951495+ scsi_for_each_prot_sg(cmd, sg,14961496+ scsi_prot_sg_count(cmd), i) {14971497+ num_ent = sg_dma_len(sg) / 8;14981498+ if (k + num_ent < blocks_done) {14991499+ k += num_ent;15001500+ continue;15011501+ }15021502+ j = blocks_done - k - 1;15031503+ k = blocks_done;15041504+ break;15051505+ }15061506+15071507+ if (k != blocks_done) {15081508+ qla_printk(KERN_WARNING, sp->fcport->vha->hw,15091509+ "unexpected tag values tag:lba=%x:%lx)\n",15101510+ e_ref_tag, lba_s);15111511+ return 1;15121512+ }15131513+15141514+ spt = page_address(sg_page(sg)) + sg->offset;15151515+ spt += j;15161516+15171517+ spt->app_tag = 0xffff;15181518+ if (scsi_get_prot_type(cmd) == SCSI_PROT_DIF_TYPE3)15191519+ spt->ref_tag = 0xffffffff;15201520+ }15211521+15221522+ return 0;15231523+ }15241524+14691525 /* check guard */14701526 if (e_guard != a_guard) {14711527 scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,···15301472 set_driver_byte(cmd, DRIVER_SENSE);15311473 set_host_byte(cmd, DID_ABORT);15321474 cmd->result |= SAM_STAT_CHECK_CONDITION << 1;15331533- return;15341534- }15351535-15361536- /* check appl tag */15371537- if (e_app_tag != a_app_tag) {15381538- scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,15391539- 0x10, 0x2);15401540- set_driver_byte(cmd, DRIVER_SENSE);15411541- set_host_byte(cmd, DID_ABORT);15421542- cmd->result |= SAM_STAT_CHECK_CONDITION << 1;15431543- return;14751475+ return 1;15441476 }1545147715461478 /* check ref tag */···15401492 set_driver_byte(cmd, DRIVER_SENSE);15411493 set_host_byte(cmd, DID_ABORT);15421494 cmd->result |= SAM_STAT_CHECK_CONDITION << 1;15431543- return;14951495+ return 1;15441496 }14971497+14981498+ /* check appl tag */14991499+ if (e_app_tag != a_app_tag) {15001500+ scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,15011501+ 0x10, 0x2);15021502+ set_driver_byte(cmd, DRIVER_SENSE);15031503+ set_host_byte(cmd, DID_ABORT);15041504+ cmd->result |= SAM_STAT_CHECK_CONDITION << 1;15051505+ return 1;15061506+ }15071507+15081508+ return 1;15451509}1546151015471511/**···18271767 break;1828176818291769 case CS_DIF_ERROR:18301830- qla2x00_handle_dif_error(sp, sts24);17701770+ logit = qla2x00_handle_dif_error(sp, sts24);18311771 break;18321772 default:18331773 cp->result = DID_ERROR << 16;···25282468 goto skip_msi;25292469 }2530247025312531- if (IS_QLA2432(ha) && (ha->pdev->revision < QLA_MSIX_CHIP_REV_24XX ||25322532- !QLA_MSIX_FW_MODE_1(ha->fw_attributes))) {24712471+ if (IS_QLA2432(ha) && (ha->pdev->revision < QLA_MSIX_CHIP_REV_24XX)) {25332472 ql_log(ql_log_warn, vha, 0x0035,25342473 "MSI-X; Unsupported ISP2432 (0x%X, 0x%X).\n",25352535- ha->pdev->revision, ha->fw_attributes);24742474+ ha->pdev->revision, QLA_MSIX_CHIP_REV_24XX);25362475 goto skip_msix;25372476 }25382477
···11config SCSI_QLA_ISCSI22 tristate "QLogic ISP4XXX and ISP82XX host adapter family support"33- depends on PCI && SCSI33+ depends on PCI && SCSI && NET44 select SCSI_ISCSI_ATTRS55 ---help---66 This driver supports the QLogic 40xx (ISP4XXX) and 8022 (ISP82XX)
+3-1
drivers/staging/comedi/drivers/ni_labpc.c
···241241 struct comedi_insn *insn,242242 unsigned int *data);243243static void labpc_adc_timing(struct comedi_device *dev, struct comedi_cmd *cmd);244244-#ifdef CONFIG_COMEDI_PCI244244+#ifdef CONFIG_ISA_DMA_API245245static unsigned int labpc_suggest_transfer_size(struct comedi_cmd cmd);246246+#endif247247+#ifdef CONFIG_COMEDI_PCI246248static int labpc_find_device(struct comedi_device *dev, int bus, int slot);247249#endif248250static int labpc_dio_mem_callback(int dir, int port, int data,
···2424 */25252626#include <linux/kernel.h>2727+#include <linux/ctype.h>2728#include <asm/unaligned.h>2829#include <scsi/scsi.h>2930···155154 return 0;156155}157156157157+static void158158+target_parse_naa_6h_vendor_specific(struct se_device *dev, unsigned char *buf_off)159159+{160160+ unsigned char *p = &dev->se_sub_dev->t10_wwn.unit_serial[0];161161+ unsigned char *buf = buf_off;162162+ int cnt = 0, next = 1;163163+ /*164164+ * Generate up to 36 bits of VENDOR SPECIFIC IDENTIFIER starting on165165+ * byte 3 bit 3-0 for NAA IEEE Registered Extended DESIGNATOR field166166+ * format, followed by 64 bits of VENDOR SPECIFIC IDENTIFIER EXTENSION167167+ * to complete the payload. These are based from VPD=0x80 PRODUCT SERIAL168168+ * NUMBER set via vpd_unit_serial in target_core_configfs.c to ensure169169+ * per device uniqeness.170170+ */171171+ while (*p != '\0') {172172+ if (cnt >= 13)173173+ break;174174+ if (!isxdigit(*p)) {175175+ p++;176176+ continue;177177+ }178178+ if (next != 0) {179179+ buf[cnt++] |= hex_to_bin(*p++);180180+ next = 0;181181+ } else {182182+ buf[cnt] = hex_to_bin(*p++) << 4;183183+ next = 1;184184+ }185185+ }186186+}187187+158188/*159189 * Device identification VPD, for a complete list of160190 * DESIGNATOR TYPEs see spc4r17 Table 459.···251219 * VENDOR_SPECIFIC_IDENTIFIER and252220 * VENDOR_SPECIFIC_IDENTIFIER_EXTENTION253221 */254254- buf[off++] |= hex_to_bin(dev->se_sub_dev->t10_wwn.unit_serial[0]);255255- hex2bin(&buf[off], &dev->se_sub_dev->t10_wwn.unit_serial[1], 12);222222+ target_parse_naa_6h_vendor_specific(dev, &buf[off]);256223257224 len = 20;258225 off = (len + 4);
+4-5
drivers/target/target_core_transport.c
···977977{978978 struct se_device *dev = container_of(work, struct se_device,979979 qf_work_queue);980980+ LIST_HEAD(qf_cmd_list);980981 struct se_cmd *cmd, *cmd_tmp;981982982983 spin_lock_irq(&dev->qf_cmd_lock);983983- list_for_each_entry_safe(cmd, cmd_tmp, &dev->qf_cmd_list, se_qf_node) {984984+ list_splice_init(&dev->qf_cmd_list, &qf_cmd_list);985985+ spin_unlock_irq(&dev->qf_cmd_lock);984986987987+ list_for_each_entry_safe(cmd, cmd_tmp, &qf_cmd_list, se_qf_node) {985988 list_del(&cmd->se_qf_node);986989 atomic_dec(&dev->dev_qf_count);987990 smp_mb__after_atomic_dec();988988- spin_unlock_irq(&dev->qf_cmd_lock);989991990992 pr_debug("Processing %s cmd: %p QUEUE_FULL in work queue"991993 " context: %s\n", cmd->se_tfo->get_fabric_name(), cmd,···999997 * has been added to head of queue1000998 */1001999 transport_add_cmd_to_queue(cmd, cmd->t_state);10021002-10031003- spin_lock_irq(&dev->qf_cmd_lock);10041000 }10051005- spin_unlock_irq(&dev->qf_cmd_lock);10061001}1007100210081003unsigned char *transport_dump_cmd_direction(struct se_cmd *cmd)
+2-10
drivers/target/tcm_fc/tcm_fc.h
···9898 struct list_head list; /* linkage in ft_lport_acl tpg_list */9999 struct list_head lun_list; /* head of LUNs */100100 struct se_portal_group se_tpg;101101- struct task_struct *thread; /* processing thread */102102- struct se_queue_obj qobj; /* queue for processing thread */101101+ struct workqueue_struct *workqueue;103102};104103105104struct ft_lport_acl {···109110 struct se_wwn fc_lport_wwn;110111};111112112112-enum ft_cmd_state {113113- FC_CMD_ST_NEW = 0,114114- FC_CMD_ST_REJ115115-};116116-117113/*118114 * Commands119115 */120116struct ft_cmd {121121- enum ft_cmd_state state;122117 u32 lun; /* LUN from request */123118 struct ft_sess *sess; /* session held for cmd */124119 struct fc_seq *seq; /* sequence in exchange mgr */···120127 struct fc_frame *req_frame;121128 unsigned char *cdb; /* pointer to CDB inside frame */122129 u32 write_data_len; /* data received on writes */123123- struct se_queue_req se_req;130130+ struct work_struct work;124131 /* Local sense buffer */125132 unsigned char ft_sense_buffer[TRANSPORT_SENSE_BUFFER];126133 u32 was_ddp_setup:1; /* Set only if ddp is setup */···170177/*171178 * other internal functions.172179 */173173-int ft_thread(void *);174180void ft_recv_req(struct ft_sess *, struct fc_frame *);175181struct ft_tpg *ft_lport_find_tpg(struct fc_lport *);176182struct ft_node_acl *ft_acl_get(struct ft_tpg *, struct fc_rport_priv *);
···327327 tpg->index = index;328328 tpg->lport_acl = lacl;329329 INIT_LIST_HEAD(&tpg->lun_list);330330- transport_init_queue_obj(&tpg->qobj);331330332331 ret = core_tpg_register(&ft_configfs->tf_ops, wwn, &tpg->se_tpg,333332 tpg, TRANSPORT_TPG_TYPE_NORMAL);···335336 return NULL;336337 }337338338338- tpg->thread = kthread_run(ft_thread, tpg, "ft_tpg%lu", index);339339- if (IS_ERR(tpg->thread)) {339339+ tpg->workqueue = alloc_workqueue("tcm_fc", 0, 1);340340+ if (!tpg->workqueue) {340341 kfree(tpg);341342 return NULL;342343 }···355356 pr_debug("del tpg %s\n",356357 config_item_name(&tpg->se_tpg.tpg_group.cg_item));357358358358- kthread_stop(tpg->thread);359359+ destroy_workqueue(tpg->workqueue);359360360361 /* Wait for sessions to be freed thru RCU, for BUG_ON below */361362 synchronize_rcu();
+30-32
drivers/target/tcm_fc/tfc_io.c
···219219 if (cmd->was_ddp_setup) {220220 BUG_ON(!ep);221221 BUG_ON(!lport);222222- }223223-224224- /*225225- * Doesn't expect payload if DDP is setup. Payload226226- * is expected to be copied directly to user buffers227227- * due to DDP (Large Rx offload),228228- */229229- buf = fc_frame_payload_get(fp, 1);230230- if (buf)231231- pr_err("%s: xid 0x%x, f_ctl 0x%x, cmd->sg %p, "222222+ /*223223+ * Since DDP (Large Rx offload) was setup for this request,224224+ * payload is expected to be copied directly to user buffers.225225+ */226226+ buf = fc_frame_payload_get(fp, 1);227227+ if (buf)228228+ pr_err("%s: xid 0x%x, f_ctl 0x%x, cmd->sg %p, "232229 "cmd->sg_cnt 0x%x. DDP was setup"233230 " hence not expected to receive frame with "234234- "payload, Frame will be dropped if "235235- "'Sequence Initiative' bit in f_ctl is "231231+ "payload, Frame will be dropped if"232232+ "'Sequence Initiative' bit in f_ctl is"236233 "not set\n", __func__, ep->xid, f_ctl,237234 cmd->sg, cmd->sg_cnt);238238- /*239239- * Invalidate HW DDP context if it was setup for respective240240- * command. Invalidation of HW DDP context is requited in both241241- * situation (success and error). 242242- */243243- ft_invl_hw_context(cmd);235235+ /*236236+ * Invalidate HW DDP context if it was setup for respective237237+ * command. Invalidation of HW DDP context is requited in both238238+ * situation (success and error).239239+ */240240+ ft_invl_hw_context(cmd);244241245245- /*246246- * If "Sequence Initiative (TSI)" bit set in f_ctl, means last247247- * write data frame is received successfully where payload is248248- * posted directly to user buffer and only the last frame's249249- * header is posted in receive queue.250250- *251251- * If "Sequence Initiative (TSI)" bit is not set, means error252252- * condition w.r.t. DDP, hence drop the packet and let explict253253- * ABORTS from other end of exchange timer trigger the recovery.254254- */255255- if (f_ctl & FC_FC_SEQ_INIT)256256- goto last_frame;257257- else258258- goto drop;242242+ /*243243+ * If "Sequence Initiative (TSI)" bit set in f_ctl, means last244244+ * write data frame is received successfully where payload is245245+ * posted directly to user buffer and only the last frame's246246+ * header is posted in receive queue.247247+ *248248+ * If "Sequence Initiative (TSI)" bit is not set, means error249249+ * condition w.r.t. DDP, hence drop the packet and let explict250250+ * ABORTS from other end of exchange timer trigger the recovery.251251+ */252252+ if (f_ctl & FC_FC_SEQ_INIT)253253+ goto last_frame;254254+ else255255+ goto drop;256256+ }259257260258 rel_off = ntohl(fh->fh_parm_offset);261259 frame_len = fr_len(fp);
+2-2
drivers/tty/serial/crisv10.c
···4450445044514451#if defined(CONFIG_ETRAX_RS485)44524452#if defined(CONFIG_ETRAX_RS485_ON_PA)44534453- if (cris_io_interface_allocate_pins(if_ser0, 'a', rs485_pa_bit,44534453+ if (cris_io_interface_allocate_pins(if_serial_0, 'a', rs485_pa_bit,44544454 rs485_pa_bit)) {44554455 printk(KERN_CRIT "ETRAX100LX serial: Could not allocate "44564456 "RS485 pin\n");···44594459 }44604460#endif44614461#if defined(CONFIG_ETRAX_RS485_ON_PORT_G)44624462- if (cris_io_interface_allocate_pins(if_ser0, 'g', rs485_pa_bit,44624462+ if (cris_io_interface_allocate_pins(if_serial_0, 'g', rs485_pa_bit,44634463 rs485_port_g_bit)) {44644464 printk(KERN_CRIT "ETRAX100LX serial: Could not allocate "44654465 "RS485 pin\n");
+1-1
drivers/usb/host/xhci-hub.c
···761761 memset(buf, 0, retval);762762 status = 0;763763764764- mask = PORT_CSC | PORT_PEC | PORT_OCC | PORT_PLC;764764+ mask = PORT_CSC | PORT_PEC | PORT_OCC | PORT_PLC | PORT_WRC;765765766766 spin_lock_irqsave(&xhci->lock, flags);767767 /* For each port, did anything change? If so, set that bit in buf. */
+19
drivers/usb/host/xhci-ring.c
···19341934 int status = -EINPROGRESS;19351935 struct urb_priv *urb_priv;19361936 struct xhci_ep_ctx *ep_ctx;19371937+ struct list_head *tmp;19371938 u32 trb_comp_code;19381939 int ret = 0;19401940+ int td_num = 0;1939194119401942 slot_id = TRB_TO_SLOT_ID(le32_to_cpu(event->flags));19411943 xdev = xhci->devs[slot_id];···19571955 xhci_err(xhci, "ERROR Transfer event for disabled endpoint "19581956 "or incorrect stream ring\n");19591957 return -ENODEV;19581958+ }19591959+19601960+ /* Count current td numbers if ep->skip is set */19611961+ if (ep->skip) {19621962+ list_for_each(tmp, &ep_ring->td_list)19631963+ td_num++;19601964 }1961196519621966 event_dma = le64_to_cpu(event->buffer);···20762068 goto cleanup;20772069 }2078207020712071+ /* We've skipped all the TDs on the ep ring when ep->skip set */20722072+ if (ep->skip && td_num == 0) {20732073+ ep->skip = false;20742074+ xhci_dbg(xhci, "All tds on the ep_ring skipped. "20752075+ "Clear skip flag.\n");20762076+ ret = 0;20772077+ goto cleanup;20782078+ }20792079+20792080 td = list_entry(ep_ring->td_list.next, struct xhci_td, td_list);20812081+ if (ep->skip)20822082+ td_num--;2080208320812084 /* Is this a TRB in the currently executing TD? */20822085 event_seg = trb_in_td(ep_ring->deq_seg, ep_ring->dequeue,
···14291429 WARN_ON_ONCE(bdev->bd_holders);14301430 sync_blockdev(bdev);14311431 kill_bdev(bdev);14321432+ /* ->release can cause the old bdi to disappear,14331433+ * so must switch it out first14341434+ */14351435+ bdev_inode_switch_bdi(bdev->bd_inode,14361436+ &default_backing_dev_info);14321437 }14331438 if (bdev->bd_contains == bdev) {14341439 if (disk->fops->release)···14471442 disk_put_part(bdev->bd_part);14481443 bdev->bd_part = NULL;14491444 bdev->bd_disk = NULL;14501450- bdev_inode_switch_bdi(bdev->bd_inode,14511451- &default_backing_dev_info);14521445 if (bdev != bdev->bd_contains)14531446 victim = bdev->bd_contains;14541447 bdev->bd_contains = NULL;
···183183 * read from the commit root and sidestep a nasty deadlock184184 * between reading the free space cache and updating the csum tree.185185 */186186- if (btrfs_is_free_space_inode(root, inode))186186+ if (btrfs_is_free_space_inode(root, inode)) {187187 path->search_commit_root = 1;188188+ path->skip_locking = 1;189189+ }188190189191 disk_bytenr = (u64)bio->bi_sector << 9;190192 if (dio)
+17-8
fs/btrfs/file.c
···10751075 start_pos = pos & ~((u64)root->sectorsize - 1);10761076 last_pos = ((u64)index + num_pages) << PAGE_CACHE_SHIFT;1077107710781078- if (start_pos > inode->i_size) {10791079- err = btrfs_cont_expand(inode, i_size_read(inode), start_pos);10801080- if (err)10811081- return err;10821082- }10831083-10841078again:10851079 for (i = 0; i < num_pages; i++) {10861080 pages[i] = find_or_create_page(inode->i_mapping, index + i,···13321338 struct inode *inode = fdentry(file)->d_inode;13331339 struct btrfs_root *root = BTRFS_I(inode)->root;13341340 loff_t *ppos = &iocb->ki_pos;13411341+ u64 start_pos;13351342 ssize_t num_written = 0;13361343 ssize_t err = 0;13371344 size_t count, ocount;···1380138513811386 file_update_time(file);13821387 BTRFS_I(inode)->sequence++;13881388+13891389+ start_pos = round_down(pos, root->sectorsize);13901390+ if (start_pos > i_size_read(inode)) {13911391+ err = btrfs_cont_expand(inode, i_size_read(inode), start_pos);13921392+ if (err) {13931393+ mutex_unlock(&inode->i_mutex);13941394+ goto out;13951395+ }13961396+ }1383139713841398 if (unlikely(file->f_flags & O_DIRECT)) {13851399 num_written = __btrfs_direct_write(iocb, iov, nr_segs,···18171813 goto out;18181814 case SEEK_DATA:18191815 case SEEK_HOLE:18161816+ if (offset >= i_size_read(inode)) {18171817+ mutex_unlock(&inode->i_mutex);18181818+ return -ENXIO;18191819+ }18201820+18201821 ret = find_desired_extent(inode, &offset, origin);18211822 if (ret) {18221823 mutex_unlock(&inode->i_mutex);···18301821 }1831182218321823 if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET)) {18331833- ret = -EINVAL;18241824+ offset = -EINVAL;18341825 goto out;18351826 }18361827 if (offset > inode->i_sb->s_maxbytes) {18371837- ret = -EINVAL;18281828+ offset = -EINVAL;18381829 goto out;18391830 }18401831
+4
fs/btrfs/free-space-cache.c
···190190 struct btrfs_path *path,191191 struct inode *inode)192192{193193+ struct btrfs_block_rsv *rsv;193194 loff_t oldsize;194195 int ret = 0;195196197197+ rsv = trans->block_rsv;196198 trans->block_rsv = root->orphan_block_rsv;197199 ret = btrfs_block_rsv_check(trans, root,198200 root->orphan_block_rsv,···212210 */213211 ret = btrfs_truncate_inode_items(trans, root, inode,214212 0, BTRFS_EXTENT_DATA_KEY);213213+214214+ trans->block_rsv = rsv;215215 if (ret) {216216 WARN_ON(1);217217 return ret;
+25-15
fs/btrfs/inode.c
···17861786 &ordered_extent->list);1787178717881788 ret = btrfs_ordered_update_i_size(inode, 0, ordered_extent);17891789- if (!ret) {17891789+ if (!ret || !test_bit(BTRFS_ORDERED_PREALLOC, &ordered_extent->flags)) {17901790 ret = btrfs_update_inode(trans, root, inode);17911791 BUG_ON(ret);17921792 }···35103510 err = btrfs_drop_extents(trans, inode, cur_offset,35113511 cur_offset + hole_size,35123512 &hint_byte, 1);35133513- if (err)35133513+ if (err) {35143514+ btrfs_end_transaction(trans, root);35143515 break;35163516+ }3515351735163518 err = btrfs_insert_file_extent(trans, root,35173519 btrfs_ino(inode), cur_offset, 0,35183520 0, hole_size, 0, hole_size,35193521 0, 0, 0);35203520- if (err)35223522+ if (err) {35233523+ btrfs_end_transaction(trans, root);35213524 break;35253525+ }3522352635233527 btrfs_drop_extent_cache(inode, hole_start,35243528 last_byte - 1, 0);···39563952 struct btrfs_root *root, int *new)39573953{39583954 struct inode *inode;39593959- int bad_inode = 0;3960395539613956 inode = btrfs_iget_locked(s, location->objectid, root);39623957 if (!inode)···39713968 if (new)39723969 *new = 1;39733970 } else {39743974- bad_inode = 1;39713971+ unlock_new_inode(inode);39723972+ iput(inode);39733973+ inode = ERR_PTR(-ESTALE);39753974 }39763976- }39773977-39783978- if (bad_inode) {39793979- iput(inode);39803980- inode = ERR_PTR(-ESTALE);39813975 }3982397639833977 return inode;···40184018 memcpy(&location, dentry->d_fsdata, sizeof(struct btrfs_key));40194019 kfree(dentry->d_fsdata);40204020 dentry->d_fsdata = NULL;40214021- d_clear_need_lookup(dentry);40214021+ /* This thing is hashed, drop it for now */40224022+ d_drop(dentry);40224023 } else {40234024 ret = btrfs_inode_by_name(dir, dentry, &location);40244025 }···40864085static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry,40874086 struct nameidata *nd)40884087{40894089- return d_splice_alias(btrfs_lookup_dentry(dir, dentry), dentry);40884088+ struct dentry *ret;40894089+40904090+ ret = d_splice_alias(btrfs_lookup_dentry(dir, dentry), dentry);40914091+ if (unlikely(d_need_lookup(dentry))) {40924092+ spin_lock(&dentry->d_lock);40934093+ dentry->d_flags &= ~DCACHE_NEED_LOOKUP;40944094+ spin_unlock(&dentry->d_lock);40954095+ }40964096+ return ret;40904097}4091409840924099unsigned char btrfs_filetype_table[] = {···4134412541354126 /* special case for "." */41364127 if (filp->f_pos == 0) {41374137- over = filldir(dirent, ".", 1, 1, btrfs_ino(inode), DT_DIR);41284128+ over = filldir(dirent, ".", 1,41294129+ filp->f_pos, btrfs_ino(inode), DT_DIR);41384130 if (over)41394131 return 0;41404132 filp->f_pos = 1;···41444134 if (filp->f_pos == 1) {41454135 u64 pino = parent_ino(filp->f_path.dentry);41464136 over = filldir(dirent, "..", 2,41474147- 2, pino, DT_DIR);41374137+ filp->f_pos, pino, DT_DIR);41484138 if (over)41494139 return 0;41504140 filp->f_pos = 2;···5833582358345824 add_pending_csums(trans, inode, ordered->file_offset, &ordered->list);58355825 ret = btrfs_ordered_update_i_size(inode, 0, ordered);58365836- if (!ret)58265826+ if (!ret || !test_bit(BTRFS_ORDERED_PREALLOC, &ordered->flags))58375827 btrfs_update_inode(trans, root, inode);58385828 ret = 0;58395829out_unlock:
+25-8
fs/btrfs/ioctl.c
···21772177 if (!(src_file->f_mode & FMODE_READ))21782178 goto out_fput;2179217921802180+ /* don't make the dst file partly checksummed */21812181+ if ((BTRFS_I(src)->flags & BTRFS_INODE_NODATASUM) !=21822182+ (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM))21832183+ goto out_fput;21842184+21802185 ret = -EISDIR;21812186 if (S_ISDIR(src->i_mode) || S_ISDIR(inode->i_mode))21822187 goto out_fput;···22252220 !IS_ALIGNED(destoff, bs))22262221 goto out_unlock;2227222222232223+ if (destoff > inode->i_size) {22242224+ ret = btrfs_cont_expand(inode, inode->i_size, destoff);22252225+ if (ret)22262226+ goto out_unlock;22272227+ }22282228+22292229+ /* truncate page cache pages from target inode range */22302230+ truncate_inode_pages_range(&inode->i_data, destoff,22312231+ PAGE_CACHE_ALIGN(destoff + len) - 1);22322232+22282233 /* do any pending delalloc/csum calc on src, one way or22292234 another, and lock file content */22302235 while (1) {···22502235 btrfs_put_ordered_extent(ordered);22512236 btrfs_wait_ordered_range(src, off, len);22522237 }22532253-22542254- /* truncate page cache pages from target inode range */22552255- truncate_inode_pages_range(&inode->i_data, off,22562256- ALIGN(off + len, PAGE_CACHE_SIZE) - 1);2257223822582239 /* clone data */22592240 key.objectid = btrfs_ino(src);···2336232523372326 if (type == BTRFS_FILE_EXTENT_REG ||23382327 type == BTRFS_FILE_EXTENT_PREALLOC) {23282328+ /*23292329+ * a | --- range to clone ---| b23302330+ * | ------------- extent ------------- |23312331+ */23322332+23332333+ /* substract range b */23342334+ if (key.offset + datal > off + len)23352335+ datal = off + len - key.offset;23362336+23372337+ /* substract range a */23392338 if (off > key.offset) {23402339 datao += off - key.offset;23412340 datal -= off - key.offset;23422341 }23432343-23442344- if (key.offset + datal > off + len)23452345- datal = off + len - key.offset;2346234223472343 ret = btrfs_drop_extents(trans, inode,23482344 new_key.offset,···24472429 if (endoff > inode->i_size)24482430 btrfs_i_size_write(inode, endoff);2449243124502450- BTRFS_I(inode)->flags = BTRFS_I(src)->flags;24512432 ret = btrfs_update_inode(trans, root, inode);24522433 BUG_ON(ret);24532434 btrfs_end_transaction(trans, root);
···121121122122 trace_ext4_evict_inode(inode);123123124124- mutex_lock(&inode->i_mutex);125125- ext4_flush_completed_IO(inode);126126- mutex_unlock(&inode->i_mutex);127124 ext4_ioend_wait(inode);128125129126 if (inode->i_nlink) {
+17-1
fs/ext4/page-io.c
···142142 unsigned long flags;143143 int ret;144144145145- mutex_lock(&inode->i_mutex);145145+ if (!mutex_trylock(&inode->i_mutex)) {146146+ /*147147+ * Requeue the work instead of waiting so that the work148148+ * items queued after this can be processed.149149+ */150150+ queue_work(EXT4_SB(inode->i_sb)->dio_unwritten_wq, &io->work);151151+ /*152152+ * To prevent the ext4-dio-unwritten thread from keeping153153+ * requeueing end_io requests and occupying cpu for too long,154154+ * yield the cpu if it sees an end_io request that has already155155+ * been requeued.156156+ */157157+ if (io->flag & EXT4_IO_END_QUEUED)158158+ yield();159159+ io->flag |= EXT4_IO_END_QUEUED;160160+ return;161161+ }146162 ret = ext4_end_io_nolock(io);147163 if (ret < 0) {148164 mutex_unlock(&inode->i_mutex);
···727727 if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_PARENT))728728 return -EISDIR; /* we actually want to stop here */729729730730- /*731731- * We don't want to mount if someone's just doing a stat and they've732732- * set AT_SYMLINK_NOFOLLOW - unless they're stat'ing a directory and733733- * appended a '/' to the name.730730+ /* We don't want to mount if someone's just doing a stat -731731+ * unless they're stat'ing a directory and appended a '/' to732732+ * the name.733733+ *734734+ * We do, however, want to mount if someone wants to open or735735+ * create a file of any type under the mountpoint, wants to736736+ * traverse through the mountpoint or wants to open the737737+ * mounted directory. Also, autofs may mark negative dentries738738+ * as being automount points. These will need the attentions739739+ * of the daemon to instantiate them before they can be used.734740 */735735- if (!(flags & LOOKUP_FOLLOW)) {736736- /* We do, however, want to mount if someone wants to open or737737- * create a file of any type under the mountpoint, wants to738738- * traverse through the mountpoint or wants to open the mounted739739- * directory.740740- * Also, autofs may mark negative dentries as being automount741741- * points. These will need the attentions of the daemon to742742- * instantiate them before they can be used.743743- */744744- if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |745745- LOOKUP_OPEN | LOOKUP_CREATE)) &&746746- path->dentry->d_inode)747747- return -EISDIR;748748- }741741+ if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |742742+ LOOKUP_OPEN | LOOKUP_CREATE)) &&743743+ path->dentry->d_inode)744744+ return -EISDIR;745745+749746 current->total_link_count++;750747 if (current->total_link_count >= 40)751748 return -ELOOP;···26162619 if (!dir->i_op->rmdir)26172620 return -EPERM;2618262126222622+ dget(dentry);26192623 mutex_lock(&dentry->d_inode->i_mutex);2620262426212625 error = -EBUSY;···2637263926382640out:26392641 mutex_unlock(&dentry->d_inode->i_mutex);26422642+ dput(dentry);26402643 if (!error)26412644 d_delete(dentry);26422645 return error;···30273028 if (error)30283029 return error;3029303030313031+ dget(new_dentry);30303032 if (target)30313033 mutex_lock(&target->i_mutex);30323034···30483048out:30493049 if (target)30503050 mutex_unlock(&target->i_mutex);30513051+ dput(new_dentry);30513052 if (!error)30523053 if (!(old_dir->i_sb->s_type->fs_flags & FS_RENAME_DOES_D_MOVE))30533054 d_move(old_dentry,new_dentry);
···3374337433753375 if (task->tk_status < 0) {33763376 /* Unless we're shutting down, schedule state recovery! */33773377- if (test_bit(NFS_CS_RENEWD, &clp->cl_res_state) != 0)33773377+ if (test_bit(NFS_CS_RENEWD, &clp->cl_res_state) == 0)33783378+ return;33793379+ if (task->tk_status != NFS4ERR_CB_PATH_DOWN) {33783380 nfs4_schedule_lease_recovery(clp);33793379- return;33813381+ return;33823382+ }33833383+ nfs4_schedule_path_down_recovery(clp);33803384 }33813385 do_renew_lease(clp, timestamp);33823386}···33903386 .rpc_release = nfs4_renew_release,33913387};3392338833933393-int nfs4_proc_async_renew(struct nfs_client *clp, struct rpc_cred *cred)33893389+static int nfs4_proc_async_renew(struct nfs_client *clp, struct rpc_cred *cred, unsigned renew_flags)33943390{33953391 struct rpc_message msg = {33963392 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENEW],···33993395 };34003396 struct nfs4_renewdata *data;3401339733983398+ if (renew_flags == 0)33993399+ return 0;34023400 if (!atomic_inc_not_zero(&clp->cl_count))34033401 return -EIO;34043404- data = kmalloc(sizeof(*data), GFP_KERNEL);34023402+ data = kmalloc(sizeof(*data), GFP_NOFS);34053403 if (data == NULL)34063404 return -ENOMEM;34073405 data->client = clp;···34123406 &nfs4_renew_ops, data);34133407}3414340834153415-int nfs4_proc_renew(struct nfs_client *clp, struct rpc_cred *cred)34093409+static int nfs4_proc_renew(struct nfs_client *clp, struct rpc_cred *cred)34163410{34173411 struct rpc_message msg = {34183412 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENEW],···55105504 return rpc_run_task(&task_setup_data);55115505}5512550655135513-static int nfs41_proc_async_sequence(struct nfs_client *clp, struct rpc_cred *cred)55075507+static int nfs41_proc_async_sequence(struct nfs_client *clp, struct rpc_cred *cred, unsigned renew_flags)55145508{55155509 struct rpc_task *task;55165510 int ret = 0;5517551155125512+ if ((renew_flags & NFS4_RENEW_TIMEOUT) == 0)55135513+ return 0;55185514 task = _nfs41_proc_sequence(clp, cred);55195515 if (IS_ERR(task))55205516 ret = PTR_ERR(task);
+9-3
fs/nfs/nfs4renewd.c
···6060 struct rpc_cred *cred;6161 long lease;6262 unsigned long last, now;6363+ unsigned renew_flags = 0;63646465 ops = clp->cl_mvops->state_renewal_ops;6566 dprintk("%s: start\n", __func__);···7372 last = clp->cl_last_renewal;7473 now = jiffies;7574 /* Are we close to a lease timeout? */7676- if (time_after(now, last + lease/3)) {7575+ if (time_after(now, last + lease/3))7676+ renew_flags |= NFS4_RENEW_TIMEOUT;7777+ if (nfs_delegations_present(clp))7878+ renew_flags |= NFS4_RENEW_DELEGATION_CB;7979+8080+ if (renew_flags != 0) {7781 cred = ops->get_state_renewal_cred_locked(clp);7882 spin_unlock(&clp->cl_lock);7983 if (cred == NULL) {8080- if (!nfs_delegations_present(clp)) {8484+ if (!(renew_flags & NFS4_RENEW_DELEGATION_CB)) {8185 set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);8286 goto out;8387 }8488 nfs_expire_all_delegations(clp);8589 } else {8690 /* Queue an asynchronous RENEW. */8787- ops->sched_state_renewal(clp, cred);9191+ ops->sched_state_renewal(clp, cred, renew_flags);8892 put_rpccred(cred);8993 goto out_exp;9094 }
···20352035 sb->s_blocksize = nfs_block_bits(server->wsize,20362036 &sb->s_blocksize_bits);2037203720382038- if (server->flags & NFS_MOUNT_NOAC)20392039- sb->s_flags |= MS_SYNCHRONOUS;20402040-20412038 sb->s_bdi = &server->backing_dev_info;2042203920432040 nfs_super_set_maxbytes(sb, server->maxfilesize);···22462249 if (server->flags & NFS_MOUNT_UNSHARED)22472250 compare_super = NULL;2248225122522252+ /* -o noac implies -o sync */22532253+ if (server->flags & NFS_MOUNT_NOAC)22542254+ sb_mntdata.mntflags |= MS_SYNCHRONOUS;22552255+22492256 /* Get a superblock - note that we may end up sharing one that already exists */22502257 s = sget(fs_type, compare_super, nfs_set_super, &sb_mntdata);22512258 if (IS_ERR(s)) {···2361236023622361 if (server->flags & NFS_MOUNT_UNSHARED)23632362 compare_super = NULL;23632363+23642364+ /* -o noac implies -o sync */23652365+ if (server->flags & NFS_MOUNT_NOAC)23662366+ sb_mntdata.mntflags |= MS_SYNCHRONOUS;2364236723652368 /* Get a superblock - note that we may end up sharing one that already exists */23662369 s = sget(&nfs_fs_type, compare_super, nfs_set_super, &sb_mntdata);···2632262726332628 if (server->flags & NFS4_MOUNT_UNSHARED)26342629 compare_super = NULL;26302630+26312631+ /* -o noac implies -o sync */26322632+ if (server->flags & NFS_MOUNT_NOAC)26332633+ sb_mntdata.mntflags |= MS_SYNCHRONOUS;2635263426362635 /* Get a superblock - note that we may end up sharing one that already exists */26372636 s = sget(&nfs4_fs_type, compare_super, nfs_set_super, &sb_mntdata);···29252916 if (server->flags & NFS4_MOUNT_UNSHARED)29262917 compare_super = NULL;2927291829192919+ /* -o noac implies -o sync */29202920+ if (server->flags & NFS_MOUNT_NOAC)29212921+ sb_mntdata.mntflags |= MS_SYNCHRONOUS;29222922+29282923 /* Get a superblock - note that we may end up sharing one that already exists */29292924 s = sget(&nfs4_fs_type, compare_super, nfs_set_super, &sb_mntdata);29302925 if (IS_ERR(s)) {···3015300230163003 if (server->flags & NFS4_MOUNT_UNSHARED)30173004 compare_super = NULL;30053005+30063006+ /* -o noac implies -o sync */30073007+ if (server->flags & NFS_MOUNT_NOAC)30083008+ sb_mntdata.mntflags |= MS_SYNCHRONOUS;3018300930193010 /* Get a superblock - note that we may end up sharing one that already exists */30203011 s = sget(&nfs4_fs_type, compare_super, nfs_set_super, &sb_mntdata);
···7070}71717272/*7373- * If the linux inode is valid, mark it dirty.7474- * Used when committing a dirty inode into a transaction so that7575- * the inode will get written back by the linux code7373+ * If the linux inode is valid, mark it dirty, else mark the dirty state7474+ * in the XFS inode to make sure we pick it up when reclaiming the inode.7675 */7776void7877xfs_mark_inode_dirty_sync(···81828283 if (!(inode->i_state & (I_WILL_FREE|I_FREEING)))8384 mark_inode_dirty_sync(inode);8585+ else {8686+ barrier();8787+ ip->i_update_core = 1;8888+ }8489}85908691void···95929693 if (!(inode->i_state & (I_WILL_FREE|I_FREEING)))9794 mark_inode_dirty(inode);9595+ else {9696+ barrier();9797+ ip->i_update_core = 1;9898+ }9999+98100}99101100102/*
+11-25
fs/xfs/xfs_super.c
···356356 mp->m_flags |= XFS_MOUNT_DELAYLOG;357357 } else if (!strcmp(this_char, MNTOPT_NODELAYLOG)) {358358 mp->m_flags &= ~XFS_MOUNT_DELAYLOG;359359+ xfs_warn(mp,360360+ "nodelaylog is deprecated and will be removed in Linux 3.3");359361 } else if (!strcmp(this_char, MNTOPT_DISCARD)) {360362 mp->m_flags |= XFS_MOUNT_DISCARD;361363 } else if (!strcmp(this_char, MNTOPT_NODISCARD)) {···879877 struct xfs_trans *tp;880878 int error;881879882882- xfs_iunlock(ip, XFS_ILOCK_SHARED);883880 tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS);884881 error = xfs_trans_reserve(tp, 0, XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0);885885-886882 if (error) {887883 xfs_trans_cancel(tp, 0);888888- /* we need to return with the lock hold shared */889889- xfs_ilock(ip, XFS_ILOCK_SHARED);890884 return error;891885 }892886893887 xfs_ilock(ip, XFS_ILOCK_EXCL);894894-895895- /*896896- * Note - it's possible that we might have pushed ourselves out of the897897- * way during trans_reserve which would flush the inode. But there's898898- * no guarantee that the inode buffer has actually gone out yet (it's899899- * delwri). Plus the buffer could be pinned anyway if it's part of900900- * an inode in another recent transaction. So we play it safe and901901- * fire off the transaction anyway.902902- */903903- xfs_trans_ijoin(tp, ip);888888+ xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL);904889 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);905905- error = xfs_trans_commit(tp, 0);906906- xfs_ilock_demote(ip, XFS_ILOCK_EXCL);907907-908908- return error;890890+ return xfs_trans_commit(tp, 0);909891}910892911893STATIC int···904918 trace_xfs_write_inode(ip);905919906920 if (XFS_FORCED_SHUTDOWN(mp))907907- return XFS_ERROR(EIO);921921+ return -XFS_ERROR(EIO);922922+ if (!ip->i_update_core)923923+ return 0;908924909925 if (wbc->sync_mode == WB_SYNC_ALL) {910926 /*···917929 * of synchronous log foces dramatically.918930 */919931 xfs_ioend_wait(ip);920920- xfs_ilock(ip, XFS_ILOCK_SHARED);921921- if (ip->i_update_core) {922922- error = xfs_log_inode(ip);923923- if (error)924924- goto out_unlock;925925- }932932+ error = xfs_log_inode(ip);933933+ if (error)934934+ goto out;935935+ return 0;926936 } else {927937 /*928938 * We make this non-blocking if the inode is contended, return
···3939 struct mem_cgroup *mem_cont,4040 int active, int file);41414242-struct memcg_scanrecord {4343- struct mem_cgroup *mem; /* scanend memory cgroup */4444- struct mem_cgroup *root; /* scan target hierarchy root */4545- int context; /* scanning context (see memcontrol.c) */4646- unsigned long nr_scanned[2]; /* the number of scanned pages */4747- unsigned long nr_rotated[2]; /* the number of rotated pages */4848- unsigned long nr_freed[2]; /* the number of freed pages */4949- unsigned long elapsed; /* nsec of time elapsed while scanning */5050-};5151-5242#ifdef CONFIG_CGROUP_MEM_RES_CTLR5343/*5444 * All "charge" functions with gfp_mask should use GFP_KERNEL or···116126mem_cgroup_get_reclaim_stat_from_page(struct page *page);117127extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg,118128 struct task_struct *p);119119-120120-extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,121121- gfp_t gfp_mask, bool noswap,122122- struct memcg_scanrecord *rec);123123-extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,124124- gfp_t gfp_mask, bool noswap,125125- struct zone *zone,126126- struct memcg_scanrecord *rec,127127- unsigned long *nr_scanned);128129129130#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP130131extern int do_swap_account;
···252252extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,253253 gfp_t gfp_mask, nodemask_t *mask);254254extern int __isolate_lru_page(struct page *page, int mode, int file);255255+extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,256256+ gfp_t gfp_mask, bool noswap);257257+extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,258258+ gfp_t gfp_mask, bool noswap,259259+ struct zone *zone,260260+ unsigned long *nr_scanned);255261extern unsigned long shrink_all_memory(unsigned long nr_pages);256262extern int vm_swappiness;257263extern int remove_mapping(struct address_space *mapping, struct page *page);
···17441744 * by default for perm_addr. In this case, the mask should be set to17451745 * all-zeroes. In this case it is assumed that the device can handle17461746 * the same number of arbitrary MAC addresses.17471747+ * @registered: protects ->resume and ->suspend sysfs callbacks against17481748+ * unregister hardware17471749 * @debugfsdir: debugfs directory used for this wiphy, will be renamed17481750 * automatically on wiphy renames17491751 * @dev: (virtual) struct device for this wiphy
···9696 */9797struct listen_sock {9898 u8 max_qlen_log;9999- /* 3 bytes hole, try to use */9999+ u8 synflood_warned;100100+ /* 2 bytes hole, try to use */100101 int qlen;101102 int qlen_young;102103 int clock_hand;
+1
include/net/sctp/command.h
···109109 SCTP_CMD_SEND_MSG, /* Send the whole use message */110110 SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */111111 SCTP_CMD_PURGE_ASCONF_QUEUE, /* Purge all asconf queues.*/112112+ SCTP_CMD_SET_ASOC, /* Restore association context */112113 SCTP_CMD_LAST113114} sctp_verb_t;114115
···3939 struct sk_buff *skb);40404141extern int datagram_send_ctl(struct net *net,4242+ struct sock *sk,4243 struct msghdr *msg,4344 struct flowi6 *fl6,4445 struct ipv6_txoptions *opt,
+55-12
kernel/events/core.c
···399399 local_irq_restore(flags);400400}401401402402-static inline void perf_cgroup_sched_out(struct task_struct *task)402402+static inline void perf_cgroup_sched_out(struct task_struct *task,403403+ struct task_struct *next)403404{404404- perf_cgroup_switch(task, PERF_CGROUP_SWOUT);405405+ struct perf_cgroup *cgrp1;406406+ struct perf_cgroup *cgrp2 = NULL;407407+408408+ /*409409+ * we come here when we know perf_cgroup_events > 0410410+ */411411+ cgrp1 = perf_cgroup_from_task(task);412412+413413+ /*414414+ * next is NULL when called from perf_event_enable_on_exec()415415+ * that will systematically cause a cgroup_switch()416416+ */417417+ if (next)418418+ cgrp2 = perf_cgroup_from_task(next);419419+420420+ /*421421+ * only schedule out current cgroup events if we know422422+ * that we are switching to a different cgroup. Otherwise,423423+ * do no touch the cgroup events.424424+ */425425+ if (cgrp1 != cgrp2)426426+ perf_cgroup_switch(task, PERF_CGROUP_SWOUT);405427}406428407407-static inline void perf_cgroup_sched_in(struct task_struct *task)429429+static inline void perf_cgroup_sched_in(struct task_struct *prev,430430+ struct task_struct *task)408431{409409- perf_cgroup_switch(task, PERF_CGROUP_SWIN);432432+ struct perf_cgroup *cgrp1;433433+ struct perf_cgroup *cgrp2 = NULL;434434+435435+ /*436436+ * we come here when we know perf_cgroup_events > 0437437+ */438438+ cgrp1 = perf_cgroup_from_task(task);439439+440440+ /* prev can never be NULL */441441+ cgrp2 = perf_cgroup_from_task(prev);442442+443443+ /*444444+ * only need to schedule in cgroup events if we are changing445445+ * cgroup during ctxsw. Cgroup events were not scheduled446446+ * out of ctxsw out if that was not the case.447447+ */448448+ if (cgrp1 != cgrp2)449449+ perf_cgroup_switch(task, PERF_CGROUP_SWIN);410450}411451412452static inline int perf_cgroup_connect(int fd, struct perf_event *event,···558518{559519}560520561561-static inline void perf_cgroup_sched_out(struct task_struct *task)521521+static inline void perf_cgroup_sched_out(struct task_struct *task,522522+ struct task_struct *next)562523{563524}564525565565-static inline void perf_cgroup_sched_in(struct task_struct *task)526526+static inline void perf_cgroup_sched_in(struct task_struct *prev,527527+ struct task_struct *task)566528{567529}568530···20301988 * cgroup event are system-wide mode only20311989 */20321990 if (atomic_read(&__get_cpu_var(perf_cgroup_events)))20332033- perf_cgroup_sched_out(task);19911991+ perf_cgroup_sched_out(task, next);20341992}2035199320361994static void task_ctx_sched_out(struct perf_event_context *ctx)···21952153 * accessing the event control register. If a NMI hits, then it will21962154 * keep the event running.21972155 */21982198-void __perf_event_task_sched_in(struct task_struct *task)21562156+void __perf_event_task_sched_in(struct task_struct *prev,21572157+ struct task_struct *task)21992158{22002159 struct perf_event_context *ctx;22012160 int ctxn;···22142171 * cgroup event are system-wide mode only22152172 */22162173 if (atomic_read(&__get_cpu_var(perf_cgroup_events)))22172217- perf_cgroup_sched_in(task);21742174+ perf_cgroup_sched_in(prev, task);22182175}2219217622202177static u64 perf_calculate_period(struct perf_event *event, u64 nsec, u64 count)···24702427 * ctxswin cgroup events which are already scheduled24712428 * in.24722429 */24732473- perf_cgroup_sched_out(current);24302430+ perf_cgroup_sched_out(current, NULL);2474243124752432 raw_spin_lock(&ctx->lock);24762433 task_ctx_sched_out(ctx);···33963353}3397335433983355static void calc_timer_values(struct perf_event *event,33993399- u64 *running,34003400- u64 *enabled)33563356+ u64 *enabled,33573357+ u64 *running)34013358{34023359 u64 now, ctx_time;34033360
+1-1
kernel/irq/chip.c
···178178 desc->depth = 1;179179 if (desc->irq_data.chip->irq_shutdown)180180 desc->irq_data.chip->irq_shutdown(&desc->irq_data);181181- if (desc->irq_data.chip->irq_disable)181181+ else if (desc->irq_data.chip->irq_disable)182182 desc->irq_data.chip->irq_disable(&desc->irq_data);183183 else184184 desc->irq_data.chip->irq_mask(&desc->irq_data);
+27-16
kernel/sched.c
···30653065#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW30663066 local_irq_disable();30673067#endif /* __ARCH_WANT_INTERRUPTS_ON_CTXSW */30683068- perf_event_task_sched_in(current);30683068+ perf_event_task_sched_in(prev, current);30693069#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW30703070 local_irq_enable();30713071#endif /* __ARCH_WANT_INTERRUPTS_ON_CTXSW */···42794279}4280428042814281/*42824282- * schedule() is the main scheduler function.42824282+ * __schedule() is the main scheduler function.42834283 */42844284-asmlinkage void __sched schedule(void)42844284+static void __sched __schedule(void)42854285{42864286 struct task_struct *prev, *next;42874287 unsigned long *switch_count;···43224322 if (to_wakeup)43234323 try_to_wake_up_local(to_wakeup);43244324 }43254325-43264326- /*43274327- * If we are going to sleep and we have plugged IO43284328- * queued, make sure to submit it to avoid deadlocks.43294329- */43304330- if (blk_needs_flush_plug(prev)) {43314331- raw_spin_unlock(&rq->lock);43324332- blk_schedule_flush_plug(prev);43334333- raw_spin_lock(&rq->lock);43344334- }43354325 }43364326 switch_count = &prev->nvcsw;43374327 }···43584368 preempt_enable_no_resched();43594369 if (need_resched())43604370 goto need_resched;43714371+}43724372+43734373+static inline void sched_submit_work(struct task_struct *tsk)43744374+{43754375+ if (!tsk->state)43764376+ return;43774377+ /*43784378+ * If we are going to sleep and we have plugged IO queued,43794379+ * make sure to submit it to avoid deadlocks.43804380+ */43814381+ if (blk_needs_flush_plug(tsk))43824382+ blk_schedule_flush_plug(tsk);43834383+}43844384+43854385+asmlinkage void schedule(void)43864386+{43874387+ struct task_struct *tsk = current;43884388+43894389+ sched_submit_work(tsk);43904390+ __schedule();43614391}43624392EXPORT_SYMBOL(schedule);43634393···4445443544464436 do {44474437 add_preempt_count_notrace(PREEMPT_ACTIVE);44484448- schedule();44384438+ __schedule();44494439 sub_preempt_count_notrace(PREEMPT_ACTIVE);4450444044514441 /*···44734463 do {44744464 add_preempt_count(PREEMPT_ACTIVE);44754465 local_irq_enable();44764476- schedule();44664466+ __schedule();44774467 local_irq_disable();44784468 sub_preempt_count(PREEMPT_ACTIVE);44794469···55985588static void __cond_resched(void)55995589{56005590 add_preempt_count(PREEMPT_ACTIVE);56015601- schedule();55915591+ __schedule();56025592 sub_preempt_count(PREEMPT_ACTIVE);56035593}56045594···74537443 struct sched_domain *sd = *per_cpu_ptr(sdd->sd, j);74547444 if (sd && (sd->flags & SD_OVERLAP))74557445 free_sched_groups(sd->groups, 0);74467446+ kfree(*per_cpu_ptr(sdd->sd, j));74567447 kfree(*per_cpu_ptr(sdd->sg, j));74577448 kfree(*per_cpu_ptr(sdd->sgp, j));74587449 }
···441441static void alarm_timer_get(struct k_itimer *timr,442442 struct itimerspec *cur_setting)443443{444444+ memset(cur_setting, 0, sizeof(struct itimerspec));445445+444446 cur_setting->it_interval =445447 ktime_to_timespec(timr->it.alarmtimer.period);446448 cur_setting->it_value =···481479 if (!rtcdev)482480 return -ENOTSUPP;483481484484- /* Save old values */485485- old_setting->it_interval =486486- ktime_to_timespec(timr->it.alarmtimer.period);487487- old_setting->it_value =488488- ktime_to_timespec(timr->it.alarmtimer.node.expires);482482+ /*483483+ * XXX HACK! Currently we can DOS a system if the interval484484+ * period on alarmtimers is too small. Cap the interval here485485+ * to 100us and solve this properly in a future patch! -jstultz486486+ */487487+ if ((new_setting->it_interval.tv_sec == 0) &&488488+ (new_setting->it_interval.tv_nsec < 100000))489489+ new_setting->it_interval.tv_nsec = 100000;490490+491491+ if (old_setting)492492+ alarm_timer_get(timr, old_setting);489493490494 /* If the timer was already set, cancel it */491495 alarm_cancel(&timr->it.alarmtimer);
···827827{828828 unsigned int i;829829 unsigned int ret;830830- unsigned int nr_found;830830+ unsigned int nr_found, nr_skip;831831832832 rcu_read_lock();833833restart:834834 nr_found = radix_tree_gang_lookup_slot(&mapping->page_tree,835835 (void ***)pages, NULL, start, nr_pages);836836 ret = 0;837837+ nr_skip = 0;837838 for (i = 0; i < nr_found; i++) {838839 struct page *page;839840repeat:···857856 * here as an exceptional entry: so skip over it -858857 * we only reach this from invalidate_mapping_pages().859858 */859859+ nr_skip++;860860 continue;861861 }862862···878876 * If all entries were removed before we could secure them,879877 * try again, because callers stop trying once 0 is returned.880878 */881881- if (unlikely(!ret && nr_found))879879+ if (unlikely(!ret && nr_found > nr_skip))882880 goto restart;883881 rcu_read_unlock();884882 return ret;
+6-166
mm/memcontrol.c
···204204static void mem_cgroup_threshold(struct mem_cgroup *mem);205205static void mem_cgroup_oom_notify(struct mem_cgroup *mem);206206207207-enum {208208- SCAN_BY_LIMIT,209209- SCAN_BY_SYSTEM,210210- NR_SCAN_CONTEXT,211211- SCAN_BY_SHRINK, /* not recorded now */212212-};213213-214214-enum {215215- SCAN,216216- SCAN_ANON,217217- SCAN_FILE,218218- ROTATE,219219- ROTATE_ANON,220220- ROTATE_FILE,221221- FREED,222222- FREED_ANON,223223- FREED_FILE,224224- ELAPSED,225225- NR_SCANSTATS,226226-};227227-228228-struct scanstat {229229- spinlock_t lock;230230- unsigned long stats[NR_SCAN_CONTEXT][NR_SCANSTATS];231231- unsigned long rootstats[NR_SCAN_CONTEXT][NR_SCANSTATS];232232-};233233-234234-const char *scanstat_string[NR_SCANSTATS] = {235235- "scanned_pages",236236- "scanned_anon_pages",237237- "scanned_file_pages",238238- "rotated_pages",239239- "rotated_anon_pages",240240- "rotated_file_pages",241241- "freed_pages",242242- "freed_anon_pages",243243- "freed_file_pages",244244- "elapsed_ns",245245-};246246-#define SCANSTAT_WORD_LIMIT "_by_limit"247247-#define SCANSTAT_WORD_SYSTEM "_by_system"248248-#define SCANSTAT_WORD_HIERARCHY "_under_hierarchy"249249-250250-251207/*252208 * The memory controller data structure. The memory controller controls both253209 * page cache and RSS per cgroup. We would eventually like to provide···269313270314 /* For oom notifier event fd */271315 struct list_head oom_notify;272272- /* For recording LRU-scan statistics */273273- struct scanstat scanstat;316316+274317 /*275318 * Should we move charges of a task when a task is moved into this276319 * mem_cgroup ? And what type of charges should we move ?···16331678}16341679#endif1635168016361636-static void __mem_cgroup_record_scanstat(unsigned long *stats,16371637- struct memcg_scanrecord *rec)16381638-{16391639-16401640- stats[SCAN] += rec->nr_scanned[0] + rec->nr_scanned[1];16411641- stats[SCAN_ANON] += rec->nr_scanned[0];16421642- stats[SCAN_FILE] += rec->nr_scanned[1];16431643-16441644- stats[ROTATE] += rec->nr_rotated[0] + rec->nr_rotated[1];16451645- stats[ROTATE_ANON] += rec->nr_rotated[0];16461646- stats[ROTATE_FILE] += rec->nr_rotated[1];16471647-16481648- stats[FREED] += rec->nr_freed[0] + rec->nr_freed[1];16491649- stats[FREED_ANON] += rec->nr_freed[0];16501650- stats[FREED_FILE] += rec->nr_freed[1];16511651-16521652- stats[ELAPSED] += rec->elapsed;16531653-}16541654-16551655-static void mem_cgroup_record_scanstat(struct memcg_scanrecord *rec)16561656-{16571657- struct mem_cgroup *mem;16581658- int context = rec->context;16591659-16601660- if (context >= NR_SCAN_CONTEXT)16611661- return;16621662-16631663- mem = rec->mem;16641664- spin_lock(&mem->scanstat.lock);16651665- __mem_cgroup_record_scanstat(mem->scanstat.stats[context], rec);16661666- spin_unlock(&mem->scanstat.lock);16671667-16681668- mem = rec->root;16691669- spin_lock(&mem->scanstat.lock);16701670- __mem_cgroup_record_scanstat(mem->scanstat.rootstats[context], rec);16711671- spin_unlock(&mem->scanstat.lock);16721672-}16731673-16741681/*16751682 * Scan the hierarchy if needed to reclaim memory. We remember the last child16761683 * we reclaimed from, so that we don't end up penalizing one child extensively···16571740 bool noswap = reclaim_options & MEM_CGROUP_RECLAIM_NOSWAP;16581741 bool shrink = reclaim_options & MEM_CGROUP_RECLAIM_SHRINK;16591742 bool check_soft = reclaim_options & MEM_CGROUP_RECLAIM_SOFT;16601660- struct memcg_scanrecord rec;16611743 unsigned long excess;16621662- unsigned long scanned;17441744+ unsigned long nr_scanned;1663174516641746 excess = res_counter_soft_limit_excess(&root_mem->res) >> PAGE_SHIFT;1665174716661748 /* If memsw_is_minimum==1, swap-out is of-no-use. */16671749 if (!check_soft && !shrink && root_mem->memsw_is_minimum)16681750 noswap = true;16691669-16701670- if (shrink)16711671- rec.context = SCAN_BY_SHRINK;16721672- else if (check_soft)16731673- rec.context = SCAN_BY_SYSTEM;16741674- else16751675- rec.context = SCAN_BY_LIMIT;16761676-16771677- rec.root = root_mem;1678175116791752 while (1) {16801753 victim = mem_cgroup_select_victim(root_mem);···17061799 css_put(&victim->css);17071800 continue;17081801 }17091709- rec.mem = victim;17101710- rec.nr_scanned[0] = 0;17111711- rec.nr_scanned[1] = 0;17121712- rec.nr_rotated[0] = 0;17131713- rec.nr_rotated[1] = 0;17141714- rec.nr_freed[0] = 0;17151715- rec.nr_freed[1] = 0;17161716- rec.elapsed = 0;17171802 /* we use swappiness of local cgroup */17181803 if (check_soft) {17191804 ret = mem_cgroup_shrink_node_zone(victim, gfp_mask,17201720- noswap, zone, &rec, &scanned);17211721- *total_scanned += scanned;18051805+ noswap, zone, &nr_scanned);18061806+ *total_scanned += nr_scanned;17221807 } else17231808 ret = try_to_free_mem_cgroup_pages(victim, gfp_mask,17241724- noswap, &rec);17251725- mem_cgroup_record_scanstat(&rec);18091809+ noswap);17261810 css_put(&victim->css);17271811 /*17281812 * At shrinking usage, we can't check we should stop here or···37523854 /* try to free all pages in this cgroup */37533855 shrink = 1;37543856 while (nr_retries && mem->res.usage > 0) {37553755- struct memcg_scanrecord rec;37563857 int progress;3757385837583859 if (signal_pending(current)) {37593860 ret = -EINTR;37603861 goto out;37613862 }37623762- rec.context = SCAN_BY_SHRINK;37633763- rec.mem = mem;37643764- rec.root = mem;37653863 progress = try_to_free_mem_cgroup_pages(mem, GFP_KERNEL,37663766- false, &rec);38643864+ false);37673865 if (!progress) {37683866 nr_retries--;37693867 /* maybe some writeback is necessary */···46034709}46044710#endif /* CONFIG_NUMA */4605471146064606-static int mem_cgroup_vmscan_stat_read(struct cgroup *cgrp,46074607- struct cftype *cft,46084608- struct cgroup_map_cb *cb)46094609-{46104610- struct mem_cgroup *mem = mem_cgroup_from_cont(cgrp);46114611- char string[64];46124612- int i;46134613-46144614- for (i = 0; i < NR_SCANSTATS; i++) {46154615- strcpy(string, scanstat_string[i]);46164616- strcat(string, SCANSTAT_WORD_LIMIT);46174617- cb->fill(cb, string, mem->scanstat.stats[SCAN_BY_LIMIT][i]);46184618- }46194619-46204620- for (i = 0; i < NR_SCANSTATS; i++) {46214621- strcpy(string, scanstat_string[i]);46224622- strcat(string, SCANSTAT_WORD_SYSTEM);46234623- cb->fill(cb, string, mem->scanstat.stats[SCAN_BY_SYSTEM][i]);46244624- }46254625-46264626- for (i = 0; i < NR_SCANSTATS; i++) {46274627- strcpy(string, scanstat_string[i]);46284628- strcat(string, SCANSTAT_WORD_LIMIT);46294629- strcat(string, SCANSTAT_WORD_HIERARCHY);46304630- cb->fill(cb, string, mem->scanstat.rootstats[SCAN_BY_LIMIT][i]);46314631- }46324632- for (i = 0; i < NR_SCANSTATS; i++) {46334633- strcpy(string, scanstat_string[i]);46344634- strcat(string, SCANSTAT_WORD_SYSTEM);46354635- strcat(string, SCANSTAT_WORD_HIERARCHY);46364636- cb->fill(cb, string, mem->scanstat.rootstats[SCAN_BY_SYSTEM][i]);46374637- }46384638- return 0;46394639-}46404640-46414641-static int mem_cgroup_reset_vmscan_stat(struct cgroup *cgrp,46424642- unsigned int event)46434643-{46444644- struct mem_cgroup *mem = mem_cgroup_from_cont(cgrp);46454645-46464646- spin_lock(&mem->scanstat.lock);46474647- memset(&mem->scanstat.stats, 0, sizeof(mem->scanstat.stats));46484648- memset(&mem->scanstat.rootstats, 0, sizeof(mem->scanstat.rootstats));46494649- spin_unlock(&mem->scanstat.lock);46504650- return 0;46514651-}46524652-46534653-46544712static struct cftype mem_cgroup_files[] = {46554713 {46564714 .name = "usage_in_bytes",···46734827 .mode = S_IRUGO,46744828 },46754829#endif46764676- {46774677- .name = "vmscan_stat",46784678- .read_map = mem_cgroup_vmscan_stat_read,46794679- .trigger = mem_cgroup_reset_vmscan_stat,46804680- },46814830};4682483146834832#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP···49365095 atomic_set(&mem->refcnt, 1);49375096 mem->move_charge_at_immigrate = 0;49385097 mutex_init(&mem->thresholds_lock);49394939- spin_lock_init(&mem->scanstat.lock);49405098 return &mem->css;49415099free_out:49425100 __mem_cgroup_free(mem);
···21402140 return NULL;21412141 }2142214221432143+ /*21442144+ * If the allocated address space is passed to a hypercall21452145+ * before being used then we cannot rely on a page fault to21462146+ * trigger an update of the page tables. So sync all the page21472147+ * tables here.21482148+ */21492149+ vmalloc_sync_all();21502150+21432151 return area;21442152}21452153EXPORT_SYMBOL_GPL(alloc_vm_area);
+17-49
mm/vmscan.c
···105105106106 /* Which cgroup do we reclaim from */107107 struct mem_cgroup *mem_cgroup;108108- struct memcg_scanrecord *memcg_record;109108110109 /*111110 * Nodemask of nodes allowed by the caller. If NULL, all nodes···13481349 int file = is_file_lru(lru);13491350 int numpages = hpage_nr_pages(page);13501351 reclaim_stat->recent_rotated[file] += numpages;13511351- if (!scanning_global_lru(sc))13521352- sc->memcg_record->nr_rotated[file] += numpages;13531352 }13541353 if (!pagevec_add(&pvec, page)) {13551354 spin_unlock_irq(&zone->lru_lock);···1391139413921395 reclaim_stat->recent_scanned[0] += *nr_anon;13931396 reclaim_stat->recent_scanned[1] += *nr_file;13941394- if (!scanning_global_lru(sc)) {13951395- sc->memcg_record->nr_scanned[0] += *nr_anon;13961396- sc->memcg_record->nr_scanned[1] += *nr_file;13971397- }13981397}1399139814001399/*···15041511 nr_reclaimed += shrink_page_list(&page_list, zone, sc);15051512 }1506151315071507- if (!scanning_global_lru(sc))15081508- sc->memcg_record->nr_freed[file] += nr_reclaimed;15091509-15101514 local_irq_disable();15111515 if (current_is_kswapd())15121516 __count_vm_events(KSWAPD_STEAL, nr_reclaimed);···16031613 }1604161416051615 reclaim_stat->recent_scanned[file] += nr_taken;16061606- if (!scanning_global_lru(sc))16071607- sc->memcg_record->nr_scanned[file] += nr_taken;1608161616091617 __count_zone_vm_events(PGREFILL, zone, pgscanned);16101618 if (file)···16541666 * get_scan_ratio.16551667 */16561668 reclaim_stat->recent_rotated[file] += nr_rotated;16571657- if (!scanning_global_lru(sc))16581658- sc->memcg_record->nr_rotated[file] += nr_rotated;1659166916601670 move_active_pages_to_lru(zone, &l_active,16611671 LRU_ACTIVE + file * LRU_FILE);···17941808 u64 fraction[2], denominator;17951809 enum lru_list l;17961810 int noswap = 0;17971797- int force_scan = 0;18111811+ bool force_scan = false;17981812 unsigned long nr_force_scan[2];1799181318001800-18011801- anon = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_ANON) +18021802- zone_nr_lru_pages(zone, sc, LRU_INACTIVE_ANON);18031803- file = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_FILE) +18041804- zone_nr_lru_pages(zone, sc, LRU_INACTIVE_FILE);18051805-18061806- if (((anon + file) >> priority) < SWAP_CLUSTER_MAX) {18071807- /* kswapd does zone balancing and need to scan this zone */18081808- if (scanning_global_lru(sc) && current_is_kswapd())18091809- force_scan = 1;18101810- /* memcg may have small limit and need to avoid priority drop */18111811- if (!scanning_global_lru(sc))18121812- force_scan = 1;18131813- }18141814+ /* kswapd does zone balancing and needs to scan this zone */18151815+ if (scanning_global_lru(sc) && current_is_kswapd())18161816+ force_scan = true;18171817+ /* memcg may have small limit and need to avoid priority drop */18181818+ if (!scanning_global_lru(sc))18191819+ force_scan = true;1814182018151821 /* If we have no swap space, do not bother scanning anon pages. */18161822 if (!sc->may_swap || (nr_swap_pages <= 0)) {···18141836 nr_force_scan[1] = SWAP_CLUSTER_MAX;18151837 goto out;18161838 }18391839+18401840+ anon = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_ANON) +18411841+ zone_nr_lru_pages(zone, sc, LRU_INACTIVE_ANON);18421842+ file = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_FILE) +18431843+ zone_nr_lru_pages(zone, sc, LRU_INACTIVE_FILE);1817184418181845 if (scanning_global_lru(sc)) {18191846 free = zone_page_state(zone, NR_FREE_PAGES);···22512268#ifdef CONFIG_CGROUP_MEM_RES_CTLR2252226922532270unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,22542254- gfp_t gfp_mask, bool noswap,22552255- struct zone *zone,22562256- struct memcg_scanrecord *rec,22572257- unsigned long *scanned)22712271+ gfp_t gfp_mask, bool noswap,22722272+ struct zone *zone,22732273+ unsigned long *nr_scanned)22582274{22592275 struct scan_control sc = {22602276 .nr_scanned = 0,···22632281 .may_swap = !noswap,22642282 .order = 0,22652283 .mem_cgroup = mem,22662266- .memcg_record = rec,22672284 };22682268- ktime_t start, end;2269228522702286 sc.gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) |22712287 (GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK);···22722292 sc.may_writepage,22732293 sc.gfp_mask);2274229422752275- start = ktime_get();22762295 /*22772296 * NOTE: Although we can get the priority field, using it22782297 * here is not a good idea, since it limits the pages we can scan.···22802301 * the priority and make it zero.22812302 */22822303 shrink_zone(0, zone, &sc);22832283- end = ktime_get();22842284-22852285- if (rec)22862286- rec->elapsed += ktime_to_ns(ktime_sub(end, start));22872287- *scanned = sc.nr_scanned;2288230422892305 trace_mm_vmscan_memcg_softlimit_reclaim_end(sc.nr_reclaimed);2290230623072307+ *nr_scanned = sc.nr_scanned;22912308 return sc.nr_reclaimed;22922309}2293231022942311unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem_cont,22952312 gfp_t gfp_mask,22962296- bool noswap,22972297- struct memcg_scanrecord *rec)23132313+ bool noswap)22982314{22992315 struct zonelist *zonelist;23002316 unsigned long nr_reclaimed;23012301- ktime_t start, end;23022317 int nid;23032318 struct scan_control sc = {23042319 .may_writepage = !laptop_mode,···23012328 .nr_to_reclaim = SWAP_CLUSTER_MAX,23022329 .order = 0,23032330 .mem_cgroup = mem_cont,23042304- .memcg_record = rec,23052331 .nodemask = NULL, /* we don't care the placement */23062332 .gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) |23072333 (GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK),···23092337 .gfp_mask = sc.gfp_mask,23102338 };2311233923122312- start = ktime_get();23132340 /*23142341 * Unlike direct reclaim via alloc_pages(), memcg's reclaim doesn't23152342 * take care of from where we get pages. So the node where we start the···23232352 sc.gfp_mask);2324235323252354 nr_reclaimed = do_try_to_free_pages(zonelist, &sc, &shrink);23262326- end = ktime_get();23272327- if (rec)23282328- rec->elapsed += ktime_to_ns(ktime_sub(end, start));2329235523302356 trace_mm_vmscan_memcg_reclaim_end(nr_reclaimed);23312357
···263263{264264 int in, out, inp, outp;265265 struct virtio_chan *chan = client->trans;266266- char *rdata = (char *)req->rc+sizeof(struct p9_fcall);267266 unsigned long flags;268267 size_t pdata_off = 0;269268 struct trans_rpage_info *rpinfo = NULL;···345346 * Arrange in such a way that server places header in the346347 * alloced memory and payload onto the user buffer.347348 */348348- inp = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata, 11);349349+ inp = pack_sg_list(chan->sg, out,350350+ VIRTQUEUE_NUM, req->rc->sdata, 11);349351 /*350352 * Running executables in the filesystem may result in351353 * a read request with kernel buffer as opposed to user buffer.···366366 }367367 in += inp;368368 } else {369369- in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata,370370- req->rc->capacity);369369+ in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM,370370+ req->rc->sdata, req->rc->capacity);371371 }372372373373 err = virtqueue_add_buf(chan->vq, chan->sg, out, in, req->tc);···592592 .close = p9_virtio_close,593593 .request = p9_virtio_request,594594 .cancel = p9_virtio_cancel,595595- .maxsize = PAGE_SIZE*VIRTQUEUE_NUM,595595+596596+ /*597597+ * We leave one entry for input and one entry for response598598+ * headers. We also skip one more entry to accomodate, address599599+ * that are not at page boundary, that can result in an extra600600+ * page in zero copy.601601+ */602602+ .maxsize = PAGE_SIZE * (VIRTQUEUE_NUM - 3),596603 .pref = P9_TRANS_PREF_PAYLOAD_SEP,597604 .def = 0,598605 .owner = THIS_MODULE,
+1-1
net/bridge/netfilter/Kconfig
···4455menuconfig BRIDGE_NF_EBTABLES66 tristate "Ethernet Bridge tables (ebtables) support"77- depends on BRIDGE && BRIDGE_NETFILTER77+ depends on BRIDGE && NETFILTER88 select NETFILTER_XTABLES99 help1010 ebtables is a general, extensible frame/packet identification
···3030 struct hlist_node hlist;3131 struct list_head gc_list;3232 } u;3333+ struct net *net;3334 u16 family;3435 u8 dir;3536 u32 genid;···173172174173static u32 flow_hash_code(struct flow_cache *fc,175174 struct flow_cache_percpu *fcp,176176- const struct flowi *key)175175+ const struct flowi *key,176176+ size_t keysize)177177{178178 const u32 *k = (const u32 *) key;179179+ const u32 length = keysize * sizeof(flow_compare_t) / sizeof(u32);179180180180- return jhash2(k, (sizeof(*key) / sizeof(u32)), fcp->hash_rnd)181181+ return jhash2(k, length, fcp->hash_rnd)181182 & (flow_cache_hash_size(fc) - 1);182183}183184184184-typedef unsigned long flow_compare_t;185185-186185/* I hear what you're saying, use memcmp. But memcmp cannot make187187- * important assumptions that we can here, such as alignment and188188- * constant size.186186+ * important assumptions that we can here, such as alignment.189187 */190190-static int flow_key_compare(const struct flowi *key1, const struct flowi *key2)188188+static int flow_key_compare(const struct flowi *key1, const struct flowi *key2,189189+ size_t keysize)191190{192191 const flow_compare_t *k1, *k1_lim, *k2;193193- const int n_elem = sizeof(struct flowi) / sizeof(flow_compare_t);194194-195195- BUILD_BUG_ON(sizeof(struct flowi) % sizeof(flow_compare_t));196192197193 k1 = (const flow_compare_t *) key1;198198- k1_lim = k1 + n_elem;194194+ k1_lim = k1 + keysize;199195200196 k2 = (const flow_compare_t *) key2;201197···213215 struct flow_cache_entry *fle, *tfle;214216 struct hlist_node *entry;215217 struct flow_cache_object *flo;218218+ size_t keysize;216219 unsigned int hash;217220218221 local_bh_disable();···221222222223 fle = NULL;223224 flo = NULL;225225+226226+ keysize = flow_key_size(family);227227+ if (!keysize)228228+ goto nocache;229229+224230 /* Packet really early in init? Making flow_cache_init a225231 * pre-smp initcall would solve this. --RR */226232 if (!fcp->hash_table)···234230 if (fcp->hash_rnd_recalc)235231 flow_new_hash_rnd(fc, fcp);236232237237- hash = flow_hash_code(fc, fcp, key);233233+ hash = flow_hash_code(fc, fcp, key, keysize);238234 hlist_for_each_entry(tfle, entry, &fcp->hash_table[hash], u.hlist) {239239- if (tfle->family == family &&235235+ if (tfle->net == net &&236236+ tfle->family == family &&240237 tfle->dir == dir &&241241- flow_key_compare(key, &tfle->key) == 0) {238238+ flow_key_compare(key, &tfle->key, keysize) == 0) {242239 fle = tfle;243240 break;244241 }···251246252247 fle = kmem_cache_alloc(flow_cachep, GFP_ATOMIC);253248 if (fle) {249249+ fle->net = net;254250 fle->family = family;255251 fle->dir = dir;256256- memcpy(&fle->key, key, sizeof(*key));252252+ memcpy(&fle->key, key, keysize * sizeof(flow_compare_t));257253 fle->object = NULL;258254 hlist_add_head(&fle->u.hlist, &fcp->hash_table[hash]);259255 fcp->hash_count++;
+17-5
net/core/skbuff.c
···611611}612612EXPORT_SYMBOL_GPL(skb_morph);613613614614-/* skb frags copy userspace buffers to kernel */615615-static int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)614614+/* skb_copy_ubufs - copy userspace skb frags buffers to kernel615615+ * @skb: the skb to modify616616+ * @gfp_mask: allocation priority617617+ *618618+ * This must be called on SKBTX_DEV_ZEROCOPY skb.619619+ * It will copy all frags into kernel and drop the reference620620+ * to userspace pages.621621+ *622622+ * If this function is called from an interrupt gfp_mask() must be623623+ * %GFP_ATOMIC.624624+ *625625+ * Returns 0 on success or a negative error code on failure626626+ * to allocate kernel memory to copy to.627627+ */628628+int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)616629{617630 int i;618631 int num_frags = skb_shinfo(skb)->nr_frags;···665652 skb_shinfo(skb)->frags[i - 1].page = head;666653 head = (struct page *)head->private;667654 }655655+656656+ skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;668657 return 0;669658}670659···692677 if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {693678 if (skb_copy_ubufs(skb, gfp_mask))694679 return NULL;695695- skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;696680 }697681698682 n = skb + 1;···817803 n = NULL;818804 goto out;819805 }820820- skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;821806 }822807 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {823808 skb_shinfo(n)->frags[i] = skb_shinfo(skb)->frags[i];···909896 if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {910897 if (skb_copy_ubufs(skb, gfp_mask))911898 goto nofrags;912912- skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;913899 }914900 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)915901 get_page(skb_shinfo(skb)->frags[i].page);
···11241124 return 0;1125112511261126 /* ...Then it's D-SACK, and must reside below snd_una completely */11271127- if (!after(end_seq, tp->snd_una))11271127+ if (after(end_seq, tp->snd_una))11281128 return 0;1129112911301130 if (!before(start_seq, tp->undo_marker))
+28-21
net/ipv4/tcp_ipv4.c
···808808 kfree(inet_rsk(req)->opt);809809}810810811811-static void syn_flood_warning(const struct sk_buff *skb)811811+/*812812+ * Return 1 if a syncookie should be sent813813+ */814814+int tcp_syn_flood_action(struct sock *sk,815815+ const struct sk_buff *skb,816816+ const char *proto)812817{813813- const char *msg;818818+ const char *msg = "Dropping request";819819+ int want_cookie = 0;820820+ struct listen_sock *lopt;821821+822822+814823815824#ifdef CONFIG_SYN_COOKIES816816- if (sysctl_tcp_syncookies)825825+ if (sysctl_tcp_syncookies) {817826 msg = "Sending cookies";818818- else827827+ want_cookie = 1;828828+ NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPREQQFULLDOCOOKIES);829829+ } else819830#endif820820- msg = "Dropping request";831831+ NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPREQQFULLDROP);821832822822- pr_info("TCP: Possible SYN flooding on port %d. %s.\n",823823- ntohs(tcp_hdr(skb)->dest), msg);833833+ lopt = inet_csk(sk)->icsk_accept_queue.listen_opt;834834+ if (!lopt->synflood_warned) {835835+ lopt->synflood_warned = 1;836836+ pr_info("%s: Possible SYN flooding on port %d. %s. "837837+ " Check SNMP counters.\n",838838+ proto, ntohs(tcp_hdr(skb)->dest), msg);839839+ }840840+ return want_cookie;824841}842842+EXPORT_SYMBOL(tcp_syn_flood_action);825843826844/*827845 * Save and compile IPv4 options into the request_sock if needed.···12531235 __be32 saddr = ip_hdr(skb)->saddr;12541236 __be32 daddr = ip_hdr(skb)->daddr;12551237 __u32 isn = TCP_SKB_CB(skb)->when;12561256-#ifdef CONFIG_SYN_COOKIES12571238 int want_cookie = 0;12581258-#else12591259-#define want_cookie 0 /* Argh, why doesn't gcc optimize this :( */12601260-#endif1261123912621240 /* Never answer to SYNs send to broadcast or multicast */12631241 if (skb_rtable(skb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))···12641250 * evidently real one.12651251 */12661252 if (inet_csk_reqsk_queue_is_full(sk) && !isn) {12671267- if (net_ratelimit())12681268- syn_flood_warning(skb);12691269-#ifdef CONFIG_SYN_COOKIES12701270- if (sysctl_tcp_syncookies) {12711271- want_cookie = 1;12721272- } else12731273-#endif12741274- goto drop;12531253+ want_cookie = tcp_syn_flood_action(sk, skb, "TCP");12541254+ if (!want_cookie)12551255+ goto drop;12751256 }1276125712771258 /* Accept backlog is full. If we have already queued enough···13121303 while (l-- > 0)13131304 *c++ ^= *hash_location++;1314130513151315-#ifdef CONFIG_SYN_COOKIES13161306 want_cookie = 0; /* not our kind of cookie */13171317-#endif13181307 tmp_ext.cookie_out_never = 0; /* false */13191308 tmp_ext.cookie_plus = tmp_opt.cookie_plus;13201309 } else if (!tp->rx_opt.cookie_in_always) {
+3-2
net/ipv6/datagram.c
···599599 return 0;600600}601601602602-int datagram_send_ctl(struct net *net,602602+int datagram_send_ctl(struct net *net, struct sock *sk,603603 struct msghdr *msg, struct flowi6 *fl6,604604 struct ipv6_txoptions *opt,605605 int *hlimit, int *tclass, int *dontfrag)···658658659659 if (addr_type != IPV6_ADDR_ANY) {660660 int strict = __ipv6_addr_src_scope(addr_type) <= IPV6_ADDR_SCOPE_LINKLOCAL;661661- if (!ipv6_chk_addr(net, &src_info->ipi6_addr,661661+ if (!inet_sk(sk)->transparent &&662662+ !ipv6_chk_addr(net, &src_info->ipi6_addr,662663 strict ? dev : NULL, 0))663664 err = -EINVAL;664665 else
+4-4
net/ipv6/ip6_flowlabel.c
···322322}323323324324static struct ip6_flowlabel *325325-fl_create(struct net *net, struct in6_flowlabel_req *freq, char __user *optval,326326- int optlen, int *err_p)325325+fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq,326326+ char __user *optval, int optlen, int *err_p)327327{328328 struct ip6_flowlabel *fl = NULL;329329 int olen;···360360 msg.msg_control = (void*)(fl->opt+1);361361 memset(&flowi6, 0, sizeof(flowi6));362362363363- err = datagram_send_ctl(net, &msg, &flowi6, fl->opt, &junk,363363+ err = datagram_send_ctl(net, sk, &msg, &flowi6, fl->opt, &junk,364364 &junk, &junk);365365 if (err)366366 goto done;···528528 if (freq.flr_label & ~IPV6_FLOWLABEL_MASK)529529 return -EINVAL;530530531531- fl = fl_create(net, &freq, optval, optlen, &err);531531+ fl = fl_create(net, sk, &freq, optval, optlen, &err);532532 if (fl == NULL)533533 return err;534534 sfl1 = kmalloc(sizeof(*sfl1), GFP_KERNEL);
···4040extern int sysctl_fast_poll_increase;4141extern char sysctl_devname[];4242extern int sysctl_max_baud_rate;4343-extern int sysctl_min_tx_turn_time;4444-extern int sysctl_max_tx_data_size;4545-extern int sysctl_max_tx_window;4343+extern unsigned int sysctl_min_tx_turn_time;4444+extern unsigned int sysctl_max_tx_data_size;4545+extern unsigned int sysctl_max_tx_window;4646extern int sysctl_max_noreply_time;4747extern int sysctl_warn_noreply_time;4848extern int sysctl_lap_keepalive_time;
+3-3
net/irda/qos.c
···6060 * Default is 10us which means using the unmodified value given by the6161 * peer except if it's 0 (0 is likely a bug in the other stack).6262 */6363-unsigned sysctl_min_tx_turn_time = 10;6363+unsigned int sysctl_min_tx_turn_time = 10;6464/*6565 * Maximum data size to be used in transmission in payload of LAP frame.6666 * There is a bit of confusion in the IrDA spec :···7575 * bytes frames or all negotiated frame sizes, but you can use the sysctl7676 * to play with this value anyway.7777 * Jean II */7878-unsigned sysctl_max_tx_data_size = 2042;7878+unsigned int sysctl_max_tx_data_size = 2042;7979/*8080 * Maximum transmit window, i.e. number of LAP frames between turn-around.8181 * This allow to override what the peer told us. Some peers are buggy and8282 * don't always support what they tell us.8383 * Jean II */8484-unsigned sysctl_max_tx_window = 7;8484+unsigned int sysctl_max_tx_window = 7;85858686static int irlap_param_baud_rate(void *instance, irda_param_t *param, int get);8787static int irlap_param_link_disconnect(void *instance, irda_param_t *parm,
···364364 break;365365366366 case PPTP_WAN_ERROR_NOTIFY:367367+ case PPTP_SET_LINK_INFO:367368 case PPTP_ECHO_REQUEST:368369 case PPTP_ECHO_REPLY:369370 /* I don't have to explain these ;) */
···16891689 case SCTP_CMD_PURGE_ASCONF_QUEUE:16901690 sctp_asconf_queue_teardown(asoc);16911691 break;16921692+16931693+ case SCTP_CMD_SET_ASOC:16941694+ asoc = cmd->obj.asoc;16951695+ break;16961696+16921697 default:16931698 pr_warn("Impossible command: %u, %p\n",16941699 cmd->verb, cmd->obj.ptr);
+6
net/sctp/sm_statefuns.c
···20472047 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));20482048 sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());2049204920502050+ /* Restore association pointer to provide SCTP command interpeter20512051+ * with a valid context in case it needs to manipulate20522052+ * the queues */20532053+ sctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC,20542054+ SCTP_ASOC((struct sctp_association *)asoc));20552055+20502056 return retval;2051205720522058nomem:
+24-9
sound/core/pcm_lib.c
···17611761 snd_pcm_uframes_t avail = 0;17621762 long wait_time, tout;1763176317641764+ init_waitqueue_entry(&wait, current);17651765+ set_current_state(TASK_INTERRUPTIBLE);17661766+ add_wait_queue(&runtime->tsleep, &wait);17671767+17641768 if (runtime->no_period_wakeup)17651769 wait_time = MAX_SCHEDULE_TIMEOUT;17661770 else {···17751771 }17761772 wait_time = msecs_to_jiffies(wait_time * 1000);17771773 }17781778- init_waitqueue_entry(&wait, current);17791779- add_wait_queue(&runtime->tsleep, &wait);17741774+17801775 for (;;) {17811776 if (signal_pending(current)) {17821777 err = -ERESTARTSYS;17831778 break;17841779 }17801780+17811781+ /*17821782+ * We need to check if space became available already17831783+ * (and thus the wakeup happened already) first to close17841784+ * the race of space already having become available.17851785+ * This check must happen after been added to the waitqueue17861786+ * and having current state be INTERRUPTIBLE.17871787+ */17881788+ if (is_playback)17891789+ avail = snd_pcm_playback_avail(runtime);17901790+ else17911791+ avail = snd_pcm_capture_avail(runtime);17921792+ if (avail >= runtime->twake)17931793+ break;17851794 snd_pcm_stream_unlock_irq(substream);17861786- tout = schedule_timeout_interruptible(wait_time);17951795+17961796+ tout = schedule_timeout(wait_time);17971797+17871798 snd_pcm_stream_lock_irq(substream);17991799+ set_current_state(TASK_INTERRUPTIBLE);17881800 switch (runtime->status->state) {17891801 case SNDRV_PCM_STATE_SUSPENDED:17901802 err = -ESTRPIPE;···18261806 err = -EIO;18271807 break;18281808 }18291829- if (is_playback)18301830- avail = snd_pcm_playback_avail(runtime);18311831- else18321832- avail = snd_pcm_capture_avail(runtime);18331833- if (avail >= runtime->twake)18341834- break;18351809 }18361810 _endloop:18111811+ set_current_state(TASK_RUNNING);18371812 remove_wait_queue(&runtime->tsleep, &wait);18381813 *availp = avail;18391814 return err;
+5-1
sound/pci/hda/hda_codec.c
···579579 return -1;580580 }581581 recursive++;582582- for (i = 0; i < nums; i++)582582+ for (i = 0; i < nums; i++) {583583+ unsigned int type = get_wcaps_type(get_wcaps(codec, conn[i]));584584+ if (type == AC_WID_PIN || type == AC_WID_AUD_OUT)585585+ continue;583586 if (snd_hda_get_conn_index(codec, conn[i], nid, recursive) >= 0)584587 return i;588588+ }585589 return -1;586590}587591EXPORT_SYMBOL_HDA(snd_hda_get_conn_index);
+1-1
sound/pci/hda/patch_cirrus.c
···535535 int index, unsigned int pval, int dir,536536 struct snd_kcontrol **kctlp)537537{538538- char tmp[32];538538+ char tmp[44];539539 struct snd_kcontrol_new knew =540540 HDA_CODEC_VOLUME_IDX(tmp, index, 0, 0, HDA_OUTPUT);541541 knew.private_value = pval;