···1010Each button (key) is represented as a sub-node of "gpio-keys":1111Subnode properties:12121313+ - gpios: OF device-tree gpio specification.1414+ - interrupts: the interrupt line for that input.1315 - label: Descriptive name of the key.1416 - linux,code: Keycode to emit.15171616-Required mutual exclusive subnode-properties:1717- - gpios: OF device-tree gpio specification.1818- - interrupts: the interrupt line for that input1818+Note that either "interrupts" or "gpios" properties can be omitted, but not1919+both at the same time. Specifying both properties is allowed.19202021Optional subnode-properties:2122 - linux,input-type: Specify event type this button/key generates.···2423 - debounce-interval: Debouncing interval time in milliseconds.2524 If not specified defaults to 5.2625 - gpio-key,wakeup: Boolean, button can wake-up the system.2626+ - linux,can-disable: Boolean, indicates that button is connected2727+ to dedicated (not shared) interrupt which can be disabled to2828+ suppress events from the button.27292830Example nodes:2931
···88 - debounce-interval : Debouncing interval time in milliseconds99 - st,scan-count : Scanning cycles elapsed before key data is updated1010 - st,no-autorepeat : If specified device will not autorepeat1111+ - keypad,num-rows : See ./matrix-keymap.txt1212+ - keypad,num-columns : See ./matrix-keymap.txt11131214Example:1315
···203203 compatible = "linux,spdif-dir";204204 };205205};206206-207207-&pinctrl {208208- /*209209- * These pins might be muxed as I2S by210210- * the bootloader, but it conflicts211211- * with the real I2S pins that are212212- * muxed using i2s_pins. We must mux213213- * those pins to a function other than214214- * I2S.215215- */216216- pinctrl-0 = <&hog_pins1 &hog_pins2>;217217- pinctrl-names = "default";218218-219219- hog_pins1: hog-pins1 {220220- marvell,pins = "mpp6", "mpp8", "mpp10",221221- "mpp12", "mpp13";222222- marvell,function = "gpio";223223- };224224-225225- hog_pins2: hog-pins2 {226226- marvell,pins = "mpp5", "mpp7", "mpp9";227227- marvell,function = "gpo";228228- };229229-};
···387387388388void __init smp_cpus_done(unsigned int max_cpus)389389{390390+ int cpu;391391+ unsigned long bogosum = 0;392392+393393+ for_each_online_cpu(cpu)394394+ bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy;395395+396396+ printk(KERN_INFO "SMP: Total of %d processors activated "397397+ "(%lu.%02lu BogoMIPS).\n",398398+ num_online_cpus(),399399+ bogosum / (500000/HZ),400400+ (bogosum / (5000/HZ)) % 100);401401+390402 hyp_mode_check();391403}392404
+5-4
arch/arm64/configs/defconfig
···11# CONFIG_LOCALVERSION_AUTO is not set22CONFIG_SYSVIPC=y33CONFIG_POSIX_MQUEUE=y44+CONFIG_FHANDLE=y45CONFIG_AUDIT=y56CONFIG_NO_HZ_IDLE=y67CONFIG_HIGH_RES_TIMERS=y···1413CONFIG_IKCONFIG=y1514CONFIG_IKCONFIG_PROC=y1615CONFIG_LOG_BUF_SHIFT=141717-CONFIG_RESOURCE_COUNTERS=y1816CONFIG_MEMCG=y1917CONFIG_MEMCG_SWAP=y2018CONFIG_MEMCG_KMEM=y2119CONFIG_CGROUP_HUGETLB=y2220# CONFIG_UTS_NS is not set2321# CONFIG_IPC_NS is not set2424-# CONFIG_PID_NS is not set2522# CONFIG_NET_NS is not set2623CONFIG_SCHED_AUTOGROUP=y2724CONFIG_BLK_DEV_INITRD=y···9192CONFIG_SERIAL_OF_PLATFORM=y9293CONFIG_VIRTIO_CONSOLE=y9394# CONFIG_HW_RANDOM is not set9494-# CONFIG_HMC_DRV is not set9595CONFIG_SPI=y9696CONFIG_SPI_PL022=y9797CONFIG_GPIO_PL061=y···131133CONFIG_EXT4_FS=y132134CONFIG_FANOTIFY=y133135CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y136136+CONFIG_QUOTA=y137137+CONFIG_AUTOFS4_FS=y134138CONFIG_FUSE_FS=y135139CONFIG_CUSE=y136140CONFIG_VFAT_FS=y···152152CONFIG_DEBUG_KERNEL=y153153CONFIG_LOCKUP_DETECTOR=y154154# CONFIG_SCHED_DEBUG is not set155155+# CONFIG_DEBUG_PREEMPT is not set155156# CONFIG_FTRACE is not set157157+CONFIG_KEYS=y156158CONFIG_SECURITY=y157159CONFIG_CRYPTO_ANSI_CPRNG=y158160CONFIG_ARM64_CRYPTO=y159161CONFIG_CRYPTO_SHA1_ARM64_CE=y160162CONFIG_CRYPTO_SHA2_ARM64_CE=y161163CONFIG_CRYPTO_GHASH_ARM64_CE=y162162-CONFIG_CRYPTO_AES_ARM64_CE=y163164CONFIG_CRYPTO_AES_ARM64_CE_CCM=y164165CONFIG_CRYPTO_AES_ARM64_CE_BLK=y165166CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y
+6-5
arch/arm64/include/asm/dma-mapping.h
···5252 dev->archdata.dma_ops = ops;5353}54545555-static inline int set_arch_dma_coherent_ops(struct device *dev)5555+static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,5656+ struct iommu_ops *iommu, bool coherent)5657{5757- dev->archdata.dma_coherent = true;5858- set_dma_ops(dev, &coherent_swiotlb_dma_ops);5959- return 0;5858+ dev->archdata.dma_coherent = coherent;5959+ if (coherent)6060+ set_dma_ops(dev, &coherent_swiotlb_dma_ops);6061}6161-#define set_arch_dma_coherent_ops set_arch_dma_coherent_ops6262+#define arch_setup_dma_ops arch_setup_dma_ops62636364/* do not use this function in a driver */6465static inline bool is_device_dma_coherent(struct device *dev)
···55#include <asm/debug-monitors.h>66#include <asm/pgtable.h>77#include <asm/memory.h>88+#include <asm/mmu_context.h>89#include <asm/smp_plat.h>910#include <asm/suspend.h>1011#include <asm/tlbflush.h>···9998 */10099 ret = __cpu_suspend_enter(arg, fn);101100 if (ret == 0) {102102- cpu_switch_mm(mm->pgd, mm);101101+ /*102102+ * We are resuming from reset with TTBR0_EL1 set to the103103+ * idmap to enable the MMU; restore the active_mm mappings in104104+ * TTBR0_EL1 unless the active_mm == &init_mm, in which case105105+ * the thread entered __cpu_suspend with TTBR0_EL1 set to106106+ * reserved TTBR0 page tables and should be restored as such.107107+ */108108+ if (mm == &init_mm)109109+ cpu_set_reserved_ttbr0();110110+ else111111+ cpu_switch_mm(mm->pgd, mm);112112+103113 flush_tlb_all();104114105115 /*
+1-1
arch/ia64/include/asm/unistd.h
···1111121213131414-#define NR_syscalls 318 /* length of syscall table */1414+#define NR_syscalls 319 /* length of syscall table */15151616/*1717 * The following defines stop scripts/checksyscalls.sh from complaining about
···365365 GET_THREAD_INFO r1366366 ldw r4, TI_PREEMPT_COUNT(r1)367367 bne r4, r0, restore_all368368-369369-need_resched:370368 ldw r4, TI_FLAGS(r1) /* ? Need resched set */371369 BTBZ r10, r4, TIF_NEED_RESCHED, restore_all372370 ldw r4, PT_ESTATUS(sp) /* ? Interrupts off */373371 andi r10, r4, ESTATUS_EPIE374372 beq r10, r0, restore_all375375- movia r4, PREEMPT_ACTIVE376376- stw r4, TI_PREEMPT_COUNT(r1)377377- rdctl r10, status /* enable intrs again */378378- ori r10, r10 ,STATUS_PIE379379- wrctl status, r10380380- PUSH r1381381- call schedule382382- POP r1383383- mov r4, r0384384- stw r4, TI_PREEMPT_COUNT(r1)385385- rdctl r10, status /* disable intrs */386386- andi r10, r10, %lo(~STATUS_PIE)387387- wrctl status, r10388388- br need_resched389389-#else390390- br restore_all373373+ call preempt_schedule_irq391374#endif375375+ br restore_all392376393377/***********************************************************************394378 * A few syscall wrappers
+10-3
arch/parisc/include/asm/ldcw.h
···33333434#endif /*!CONFIG_PA20*/35353636-/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */3636+/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*.3737+ We don't explicitly expose that "*a" may be written as reload3838+ fails to find a register in class R1_REGS when "a" needs to be3939+ reloaded when generating 64-bit PIC code. Instead, we clobber4040+ memory to indicate to the compiler that the assembly code reads4141+ or writes to items other than those listed in the input and output4242+ operands. This may pessimize the code somewhat but __ldcw is4343+ usually used within code blocks surrounded by memory barriors. */3744#define __ldcw(a) ({ \3845 unsigned __ret; \3939- __asm__ __volatile__(__LDCW " 0(%2),%0" \4040- : "=r" (__ret), "+m" (*(a)) : "r" (a)); \4646+ __asm__ __volatile__(__LDCW " 0(%1),%0" \4747+ : "=r" (__ret) : "r" (a) : "memory"); \4148 __ret; \4249})4350
···330330 * using debugger IPI.331331 */332332333333- if (crashing_cpu == -1)333333+ if (!kdump_in_progress())334334 kexec_prepare_cpus();335335336336 pr_debug("kexec: Starting switchover sequence.\n");
+1-8
arch/powerpc/kernel/smp.c
···700700 smp_store_cpu_info(cpu);701701 set_dec(tb_ticks_per_jiffy);702702 preempt_disable();703703+ cpu_callin_map[cpu] = 1;703704704705 if (smp_ops->setup_cpu)705706 smp_ops->setup_cpu(cpu);···738737 smp_wmb();739738 notify_cpu_starting(cpu);740739 set_cpu_online(cpu, true);741741-742742- /*743743- * CPU must be marked active and online before we signal back to the744744- * master, because the scheduler needs to see the cpu_online and745745- * cpu_active bits set.746746- */747747- smp_wmb();748748- cpu_callin_map[cpu] = 1;749740750741 local_irq_enable();751742
+7-1
arch/powerpc/platforms/pseries/lpar.c
···4343#include <asm/trace.h>4444#include <asm/firmware.h>4545#include <asm/plpar_wrappers.h>4646+#include <asm/kexec.h>4647#include <asm/fadump.h>47484849#include "pseries.h"···268267 * out to the user, but at least this will stop us from269268 * continuing on further and creating an even more270269 * difficult to debug situation.270270+ *271271+ * There is a known problem when kdump'ing, if cpus are offline272272+ * the above call will fail. Rather than panicking again, keep273273+ * going and hope the kdump kernel is also little endian, which274274+ * it usually is.271275 */272272- if (rc)276276+ if (rc && !kdump_in_progress())273277 panic("Could not enable big endian exceptions");274278 }275279#endif
···20882088 * Returns a valid pointer to struct generic_pm_domain on success or ERR_PTR()20892089 * on failure.20902090 */20912091-static struct generic_pm_domain *of_genpd_get_from_provider(20912091+struct generic_pm_domain *of_genpd_get_from_provider(20922092 struct of_phandle_args *genpdspec)20932093{20942094 struct generic_pm_domain *genpd = ERR_PTR(-ENOENT);···2108210821092109 return genpd;21102110}21112111+EXPORT_SYMBOL_GPL(of_genpd_get_from_provider);2111211221122113/**21132114 * genpd_dev_pm_detach - Detach a device from its PM domain.
+31-8
drivers/base/power/opp.c
···108108/* Lock to allow exclusive modification to the device and opp lists */109109static DEFINE_MUTEX(dev_opp_list_lock);110110111111+#define opp_rcu_lockdep_assert() \112112+do { \113113+ rcu_lockdep_assert(rcu_read_lock_held() || \114114+ lockdep_is_held(&dev_opp_list_lock), \115115+ "Missing rcu_read_lock() or " \116116+ "dev_opp_list_lock protection"); \117117+} while (0)118118+111119/**112120 * find_device_opp() - find device_opp struct using device pointer113121 * @dev: device pointer used to lookup device OPPs···216208 * This function returns the number of available opps if there are any,217209 * else returns 0 if none or the corresponding error value.218210 *219219- * Locking: This function must be called under rcu_read_lock(). This function220220- * internally references two RCU protected structures: device_opp and opp which221221- * are safe as long as we are under a common RCU locked section.211211+ * Locking: This function takes rcu_read_lock().222212 */223213int dev_pm_opp_get_opp_count(struct device *dev)224214{···224218 struct dev_pm_opp *temp_opp;225219 int count = 0;226220221221+ rcu_read_lock();222222+227223 dev_opp = find_device_opp(dev);228224 if (IS_ERR(dev_opp)) {229229- int r = PTR_ERR(dev_opp);230230- dev_err(dev, "%s: device OPP not found (%d)\n", __func__, r);231231- return r;225225+ count = PTR_ERR(dev_opp);226226+ dev_err(dev, "%s: device OPP not found (%d)\n",227227+ __func__, count);228228+ goto out_unlock;232229 }233230234231 list_for_each_entry_rcu(temp_opp, &dev_opp->opp_list, node) {···239230 count++;240231 }241232233233+out_unlock:234234+ rcu_read_unlock();242235 return count;243236}244237EXPORT_SYMBOL_GPL(dev_pm_opp_get_opp_count);···277266{278267 struct device_opp *dev_opp;279268 struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE);269269+270270+ opp_rcu_lockdep_assert();280271281272 dev_opp = find_device_opp(dev);282273 if (IS_ERR(dev_opp)) {···325312{326313 struct device_opp *dev_opp;327314 struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE);315315+316316+ opp_rcu_lockdep_assert();328317329318 if (!dev || !freq) {330319 dev_err(dev, "%s: Invalid argument freq=%p\n", __func__, freq);···375360{376361 struct device_opp *dev_opp;377362 struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE);363363+364364+ opp_rcu_lockdep_assert();378365379366 if (!dev || !freq) {380367 dev_err(dev, "%s: Invalid argument freq=%p\n", __func__, freq);···800783801784 /* Check for existing list for 'dev' */802785 dev_opp = find_device_opp(dev);803803- if (WARN(IS_ERR(dev_opp), "%s: dev_opp: %ld\n", dev_name(dev),804804- PTR_ERR(dev_opp)))786786+ if (IS_ERR(dev_opp)) {787787+ int error = PTR_ERR(dev_opp);788788+ if (error != -ENODEV)789789+ WARN(1, "%s: dev_opp: %d\n",790790+ IS_ERR_OR_NULL(dev) ?791791+ "Invalid device" : dev_name(dev),792792+ error);805793 return;794794+ }806795807796 /* Hold our list modification lock here */808797 mutex_lock(&dev_opp_list_lock);
+1-1
drivers/char/agp/ali-agp.c
···417417module_init(agp_ali_init);418418module_exit(agp_ali_cleanup);419419420420-MODULE_AUTHOR("Dave Jones <davej@redhat.com>");420420+MODULE_AUTHOR("Dave Jones");421421MODULE_LICENSE("GPL and additional rights");422422
+1-1
drivers/char/agp/amd64-agp.c
···813813module_init(agp_amd64_mod_init);814814module_exit(agp_amd64_cleanup);815815816816-MODULE_AUTHOR("Dave Jones <davej@redhat.com>, Andi Kleen");816816+MODULE_AUTHOR("Dave Jones, Andi Kleen");817817module_param(agp_try_unsupported, bool, 0);818818MODULE_LICENSE("GPL");
+1-1
drivers/char/agp/ati-agp.c
···579579module_init(agp_ati_init);580580module_exit(agp_ati_cleanup);581581582582-MODULE_AUTHOR("Dave Jones <davej@redhat.com>");582582+MODULE_AUTHOR("Dave Jones");583583MODULE_LICENSE("GPL and additional rights");584584
+1-1
drivers/char/agp/backend.c
···356356__setup("agp=", agp_setup);357357#endif358358359359-MODULE_AUTHOR("Dave Jones <davej@redhat.com>");359359+MODULE_AUTHOR("Dave Jones, Jeff Hartmann");360360MODULE_DESCRIPTION("AGP GART driver");361361MODULE_LICENSE("GPL and additional rights");362362MODULE_ALIAS_MISCDEV(AGPGART_MINOR);
+1-1
drivers/char/agp/intel-agp.c
···920920module_init(agp_intel_init);921921module_exit(agp_intel_cleanup);922922923923-MODULE_AUTHOR("Dave Jones <davej@redhat.com>");923923+MODULE_AUTHOR("Dave Jones, Various @Intel");924924MODULE_LICENSE("GPL and additional rights");
+1-1
drivers/char/agp/intel-gtt.c
···14381438}14391439EXPORT_SYMBOL(intel_gmch_remove);1440144014411441-MODULE_AUTHOR("Dave Jones <davej@redhat.com>");14411441+MODULE_AUTHOR("Dave Jones, Various @Intel");14421442MODULE_LICENSE("GPL and additional rights");
+1-1
drivers/char/agp/nvidia-agp.c
···11/*22 * Nvidia AGPGART routines.33 * Based upon a 2.4 agpgart diff by the folks from NVIDIA, and hacked up44- * to work in 2.5 by Dave Jones <davej@redhat.com>44+ * to work in 2.5 by Dave Jones.55 */6677#include <linux/module.h>
+1-1
drivers/char/agp/via-agp.c
···595595module_exit(agp_via_cleanup);596596597597MODULE_LICENSE("GPL");598598-MODULE_AUTHOR("Dave Jones <davej@redhat.com>");598598+MODULE_AUTHOR("Dave Jones");
···462462463463 /* Register the CP15 based counter if we have one */464464 if (type & ARCH_CP15_TIMER) {465465- if (arch_timer_use_virtual)465465+ if (IS_ENABLED(CONFIG_ARM64) || arch_timer_use_virtual)466466 arch_timer_read_counter = arch_counter_get_cntvct;467467 else468468 arch_timer_read_counter = arch_counter_get_cntpct;
+11
drivers/cpufreq/cpufreq-dt.c
···211211 /* OPPs might be populated at runtime, don't check for error here */212212 of_init_opp_table(cpu_dev);213213214214+ /*215215+ * But we need OPP table to function so if it is not there let's216216+ * give platform code chance to provide it for us.217217+ */218218+ ret = dev_pm_opp_get_opp_count(cpu_dev);219219+ if (ret <= 0) {220220+ pr_debug("OPP table is not ready, deferring probe\n");221221+ ret = -EPROBE_DEFER;222222+ goto out_free_opp;223223+ }224224+214225 priv = kzalloc(sizeof(*priv), GFP_KERNEL);215226 if (!priv) {216227 ret = -ENOMEM;
+6
drivers/cpufreq/cpufreq.c
···20282028 /* Don't start any governor operations if we are entering suspend */20292029 if (cpufreq_suspended)20302030 return 0;20312031+ /*20322032+ * Governor might not be initiated here if ACPI _PPC changed20332033+ * notification happened, so check it.20342034+ */20352035+ if (!policy->governor)20362036+ return -EINVAL;2031203720322038 if (policy->governor->max_transition_latency &&20332039 policy->cpuinfo.transition_latency >
···396396 * power state and occurrence of the wakeup event.397397 *398398 * If the entered idle state didn't support residency measurements,399399- * we are basically lost in the dark how much time passed.400400- * As a compromise, assume we slept for the whole expected time.399399+ * we use them anyway if they are short, and if long,400400+ * truncate to the whole expected time.401401 *402402 * Any measured amount of time will include the exit latency.403403 * Since we are interested in when the wakeup begun, not when it···405405 * the measured amount of time is less than the exit latency,406406 * assume the state was never reached and the exit latency is 0.407407 */408408- if (unlikely(target->flags & CPUIDLE_FLAG_TIME_INVALID)) {409409- /* Use timer value as is */408408+409409+ /* measured value */410410+ measured_us = cpuidle_get_last_residency(dev);411411+412412+ /* Deduct exit latency */413413+ if (measured_us > target->exit_latency)414414+ measured_us -= target->exit_latency;415415+416416+ /* Make sure our coefficients do not exceed unity */417417+ if (measured_us > data->next_timer_us)410418 measured_us = data->next_timer_us;411411-412412- } else {413413- /* Use measured value */414414- measured_us = cpuidle_get_last_residency(dev);415415-416416- /* Deduct exit latency */417417- if (measured_us > target->exit_latency)418418- measured_us -= target->exit_latency;419419-420420- /* Make sure our coefficients do not exceed unity */421421- if (measured_us > data->next_timer_us)422422- measured_us = data->next_timer_us;423423- }424419425420 /* Update our correction ratio */426421 new_factor = data->correction_factor[data->bucket];
···299299 struct kfd_dev *dev;300300 struct kfd_process_device *pdd;301301302302- mutex_lock(&process->mutex);303303-304302 /*Iterating over all devices*/305303 while ((dev = kfd_topology_enum_kfd_devices(id)) != NULL &&306304 id < NUM_OF_SUPPORTED_GPUS) {307305308306 pdd = kfd_get_process_device_data(dev, process, 1);307307+ if (!pdd)308308+ return -1;309309310310 /*311311 * For 64 bit process aperture will be statically reserved in···347347348348 id++;349349 }350350-351351- mutex_unlock(&process->mutex);352350353351 return 0;354352}
···4545 KGD_POOL_FRAMEBUFFER = 3,4646};47474848+enum kgd_engine_type {4949+ KGD_ENGINE_PFP = 1,5050+ KGD_ENGINE_ME,5151+ KGD_ENGINE_CE,5252+ KGD_ENGINE_MEC1,5353+ KGD_ENGINE_MEC2,5454+ KGD_ENGINE_RLC,5555+ KGD_ENGINE_SDMA,5656+ KGD_ENGINE_MAX5757+};5858+4859struct kgd2kfd_shared_resources {4960 /* Bit n == 1 means VMID n is available for KFD. */5061 unsigned int compute_vmid_bitmap;···148137 *149138 * @hqd_destroy: Destructs and preempts the queue assigned to that hqd slot.150139 *140140+ * @get_fw_version: Returns FW versions from the header141141+ *151142 * This structure contains function pointers to services that the kgd driver152143 * provides to amdkfd driver.153144 *···189176 int (*hqd_destroy)(struct kgd_dev *kgd, uint32_t reset_type,190177 unsigned int timeout, uint32_t pipe_id,191178 uint32_t queue_id);179179+ uint16_t (*get_fw_version)(struct kgd_dev *kgd,180180+ enum kgd_engine_type type);192181};193182194183bool kgd2kfd_init(unsigned interface_version,
+1-1
drivers/gpu/drm/drm_atomic_helper.c
···6161 struct drm_crtc_state *crtc_state;62626363 if (plane->state->crtc) {6464- crtc_state = state->crtc_states[drm_crtc_index(plane->crtc)];6464+ crtc_state = state->crtc_states[drm_crtc_index(plane->state->crtc)];65656666 if (WARN_ON(!crtc_state))6767 return;
+60
drivers/gpu/drm/drm_irq.c
···830830 * vblank events since the system was booted, including lost events due to831831 * modesetting activity.832832 *833833+ * This is the legacy version of drm_crtc_vblank_count().834834+ *833835 * Returns:834836 * The software vblank counter.835837 */···844842 return atomic_read(&vblank->count);845843}846844EXPORT_SYMBOL(drm_vblank_count);845845+846846+/**847847+ * drm_crtc_vblank_count - retrieve "cooked" vblank counter value848848+ * @crtc: which counter to retrieve849849+ *850850+ * Fetches the "cooked" vblank count value that represents the number of851851+ * vblank events since the system was booted, including lost events due to852852+ * modesetting activity.853853+ *854854+ * This is the native KMS version of drm_vblank_count().855855+ *856856+ * Returns:857857+ * The software vblank counter.858858+ */859859+u32 drm_crtc_vblank_count(struct drm_crtc *crtc)860860+{861861+ return drm_vblank_count(crtc->dev, drm_crtc_index(crtc));862862+}863863+EXPORT_SYMBOL(drm_crtc_vblank_count);847864848865/**849866 * drm_vblank_count_and_time - retrieve "cooked" vblank counter value···925904 *926905 * Updates sequence # and timestamp on event, and sends it to userspace.927906 * Caller must hold event lock.907907+ *908908+ * This is the legacy version of drm_crtc_send_vblank_event().928909 */929910void drm_send_vblank_event(struct drm_device *dev, int crtc,930911 struct drm_pending_vblank_event *e)···944921 send_vblank_event(dev, e, seq, &now);945922}946923EXPORT_SYMBOL(drm_send_vblank_event);924924+925925+/**926926+ * drm_crtc_send_vblank_event - helper to send vblank event after pageflip927927+ * @crtc: the source CRTC of the vblank event928928+ * @e: the event to send929929+ *930930+ * Updates sequence # and timestamp on event, and sends it to userspace.931931+ * Caller must hold event lock.932932+ *933933+ * This is the native KMS version of drm_send_vblank_event().934934+ */935935+void drm_crtc_send_vblank_event(struct drm_crtc *crtc,936936+ struct drm_pending_vblank_event *e)937937+{938938+ drm_send_vblank_event(crtc->dev, drm_crtc_index(crtc), e);939939+}940940+EXPORT_SYMBOL(drm_crtc_send_vblank_event);947941948942/**949943 * drm_vblank_enable - enable the vblank interrupt on a CRTC···16341594 *16351595 * Drivers should call this routine in their vblank interrupt handlers to16361596 * update the vblank counter and send any signals that may be pending.15971597+ *15981598+ * This is the legacy version of drm_crtc_handle_vblank().16371599 */16381600bool drm_handle_vblank(struct drm_device *dev, int crtc)16391601{···17121670 return true;17131671}17141672EXPORT_SYMBOL(drm_handle_vblank);16731673+16741674+/**16751675+ * drm_crtc_handle_vblank - handle a vblank event16761676+ * @crtc: where this event occurred16771677+ *16781678+ * Drivers should call this routine in their vblank interrupt handlers to16791679+ * update the vblank counter and send any signals that may be pending.16801680+ *16811681+ * This is the native KMS version of drm_handle_vblank().16821682+ *16831683+ * Returns:16841684+ * True if the event was successfully handled, false on failure.16851685+ */16861686+bool drm_crtc_handle_vblank(struct drm_crtc *crtc)16871687+{16881688+ return drm_handle_vblank(crtc->dev, drm_crtc_index(crtc));16891689+}16901690+EXPORT_SYMBOL(drm_crtc_handle_vblank);
···61916191 valleyview_cleanup_gt_powersave(dev);61926192}6193619361946194+static void gen6_suspend_rps(struct drm_device *dev)61956195+{61966196+ struct drm_i915_private *dev_priv = dev->dev_private;61976197+61986198+ flush_delayed_work(&dev_priv->rps.delayed_resume_work);61996199+62006200+ /*62016201+ * TODO: disable RPS interrupts on GEN9+ too once RPS support62026202+ * is added for it.62036203+ */62046204+ if (INTEL_INFO(dev)->gen < 9)62056205+ gen6_disable_rps_interrupts(dev);62066206+}62076207+61946208/**61956209 * intel_suspend_gt_powersave - suspend PM work and helper threads61966210 * @dev: drm device···62206206 if (INTEL_INFO(dev)->gen < 6)62216207 return;6222620862236223- flush_delayed_work(&dev_priv->rps.delayed_resume_work);62246224-62256225- /*62266226- * TODO: disable RPS interrupts on GEN9+ too once RPS support62276227- * is added for it.62286228- */62296229- if (INTEL_INFO(dev)->gen < 9)62306230- gen6_disable_rps_interrupts(dev);62096209+ gen6_suspend_rps(dev);6231621062326211 /* Force GPU to min freq during suspend */62336212 gen6_rps_idle(dev_priv);···63236316{63246317 struct drm_i915_private *dev_priv = dev->dev_private;6325631863196319+ if (INTEL_INFO(dev)->gen < 6)63206320+ return;63216321+63226322+ gen6_suspend_rps(dev);63266323 dev_priv->rps.enabled = false;63276327- intel_enable_gt_powersave(dev);63286324}6329632563306326static void ibx_init_clock_gating(struct drm_device *dev)
+3
drivers/gpu/drm/i915/intel_ringbuffer.c
···362362 flags |= PIPE_CONTROL_VF_CACHE_INVALIDATE;363363 flags |= PIPE_CONTROL_CONST_CACHE_INVALIDATE;364364 flags |= PIPE_CONTROL_STATE_CACHE_INVALIDATE;365365+ flags |= PIPE_CONTROL_MEDIA_STATE_CLEAR;365366 /*366367 * TLB invalidate requires a post-sync write.367368 */368369 flags |= PIPE_CONTROL_QW_WRITE;369370 flags |= PIPE_CONTROL_GLOBAL_GTT_IVB;371371+372372+ flags |= PIPE_CONTROL_STALL_AT_SCOREBOARD;370373371374 /* Workaround: we must issue a pipe_control with CS-stall bit372375 * set before a pipe_control command that has the state cache
+2-4
drivers/gpu/drm/msm/adreno/adreno_gpu.c
···386386 msm_gem_put_iova(gpu->memptrs_bo, gpu->base.id);387387 drm_gem_object_unreference(gpu->memptrs_bo);388388 }389389- if (gpu->pm4)390390- release_firmware(gpu->pm4);391391- if (gpu->pfp)392392- release_firmware(gpu->pfp);389389+ release_firmware(gpu->pm4);390390+ release_firmware(gpu->pfp);393391 msm_gpu_cleanup(&gpu->base);394392}
+22-31
drivers/gpu/drm/msm/hdmi/hdmi_connector.c
···141141 uint32_t hpd_ctrl;142142 int i, ret;143143144144+ for (i = 0; i < config->hpd_reg_cnt; i++) {145145+ ret = regulator_enable(hdmi->hpd_regs[i]);146146+ if (ret) {147147+ dev_err(dev->dev, "failed to enable hpd regulator: %s (%d)\n",148148+ config->hpd_reg_names[i], ret);149149+ goto fail;150150+ }151151+ }152152+144153 ret = gpio_config(hdmi, true);145154 if (ret) {146155 dev_err(dev->dev, "failed to configure GPIOs: %d\n", ret);···169160 if (ret) {170161 dev_err(dev->dev, "failed to enable hpd clk: %s (%d)\n",171162 config->hpd_clk_names[i], ret);172172- goto fail;173173- }174174- }175175-176176- for (i = 0; i < config->hpd_reg_cnt; i++) {177177- ret = regulator_enable(hdmi->hpd_regs[i]);178178- if (ret) {179179- dev_err(dev->dev, "failed to enable hpd regulator: %s (%d)\n",180180- config->hpd_reg_names[i], ret);181163 goto fail;182164 }183165 }···200200 return ret;201201}202202203203-static int hdp_disable(struct hdmi_connector *hdmi_connector)203203+static void hdp_disable(struct hdmi_connector *hdmi_connector)204204{205205 struct hdmi *hdmi = hdmi_connector->hdmi;206206 const struct hdmi_platform_config *config = hdmi->config;···212212213213 hdmi_set_mode(hdmi, false);214214215215- for (i = 0; i < config->hpd_reg_cnt; i++) {216216- ret = regulator_disable(hdmi->hpd_regs[i]);217217- if (ret) {218218- dev_err(dev->dev, "failed to disable hpd regulator: %s (%d)\n",219219- config->hpd_reg_names[i], ret);220220- goto fail;221221- }222222- }223223-224215 for (i = 0; i < config->hpd_clk_cnt; i++)225216 clk_disable_unprepare(hdmi->hpd_clks[i]);226217227218 ret = gpio_config(hdmi, false);228228- if (ret) {229229- dev_err(dev->dev, "failed to unconfigure GPIOs: %d\n", ret);230230- goto fail;219219+ if (ret)220220+ dev_warn(dev->dev, "failed to unconfigure GPIOs: %d\n", ret);221221+222222+ for (i = 0; i < config->hpd_reg_cnt; i++) {223223+ ret = regulator_disable(hdmi->hpd_regs[i]);224224+ if (ret)225225+ dev_warn(dev->dev, "failed to disable hpd regulator: %s (%d)\n",226226+ config->hpd_reg_names[i], ret);231227 }232232-233233- return 0;234234-235235-fail:236236- return ret;237228}238229239230static void···251260 (hpd_int_status & HDMI_HPD_INT_STATUS_INT)) {252261 bool detected = !!(hpd_int_status & HDMI_HPD_INT_STATUS_CABLE_DETECTED);253262254254- DBG("status=%04x, ctrl=%04x", hpd_int_status, hpd_int_ctrl);255255-256256- /* ack the irq: */263263+ /* ack & disable (temporarily) HPD events: */257264 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL,258258- hpd_int_ctrl | HDMI_HPD_INT_CTRL_INT_ACK);265265+ HDMI_HPD_INT_CTRL_INT_ACK);266266+267267+ DBG("status=%04x, ctrl=%04x", hpd_int_status, hpd_int_ctrl);259268260269 /* detect disconnect if we are connected or visa versa: */261270 hpd_int_ctrl = HDMI_HPD_INT_CTRL_INT_EN;
···303303304304 DBG("%s: check", mdp5_crtc->name);305305306306- if (mdp5_crtc->event) {307307- dev_err(dev->dev, "already pending flip!\n");308308- return -EBUSY;309309- }310310-311306 /* request a free CTL, if none is already allocated for this CRTC */312307 if (state->enable && !mdp5_crtc->ctl) {313308 mdp5_crtc->ctl = mdp5_ctlm_request(mdp5_kms->ctlm, crtc);···359364 struct drm_device *dev = crtc->dev;360365 unsigned long flags;361366362362- DBG("%s: flush", mdp5_crtc->name);367367+ DBG("%s: event: %p", mdp5_crtc->name, crtc->state->event);363368364369 WARN_ON(mdp5_crtc->event);365370···455460 /* now that we know what irq's we want: */456461 mdp5_crtc->err.irqmask = intf2err(intf);457462 mdp5_crtc->vblank.irqmask = intf2vblank(intf);458458-459459- /* when called from modeset_init(), skip the rest until later: */460460- if (!mdp5_kms)461461- return;463463+ mdp_irq_update(&mdp5_kms->base);462464463465 spin_lock_irqsave(&mdp5_kms->resource_lock, flags);464466 intf_sel = mdp5_read(mdp5_kms, REG_MDP5_DISP_INTF_SEL);
+1-11
drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
···216216 goto fail;217217 }218218219219- /* NOTE: the vsync and error irq's are actually associated with220220- * the INTF/encoder.. the easiest way to deal with this (ie. what221221- * we do now) is assume a fixed relationship between crtc's and222222- * encoders. I'm not sure if there is ever a need to more freely223223- * assign crtcs to encoders, but if there is then we need to take224224- * care of error and vblank irq's that the crtc has registered,225225- * and also update user-requested vblank_mask.226226- */227227- encoder->possible_crtcs = BIT(0);228228- mdp5_crtc_set_intf(priv->crtcs[0], 3, INTF_HDMI);229229-219219+ encoder->possible_crtcs = (1 << priv->num_crtcs) - 1;;230220 priv->encoders[priv->num_encoders++] = encoder;231221232222 /* Construct bridge/connector for HDMI: */
+6-3
drivers/gpu/drm/msm/mdp/mdp_kms.c
···4242 mdp_kms->funcs->set_irqmask(mdp_kms, irqmask);4343}44444545-static void update_irq_unlocked(struct mdp_kms *mdp_kms)4545+/* if an mdp_irq's irqmask has changed, such as when mdp5 crtc<->encoder4646+ * link changes, this must be called to figure out the new global irqmask4747+ */4848+void mdp_irq_update(struct mdp_kms *mdp_kms)4649{4750 unsigned long flags;4851 spin_lock_irqsave(&list_lock, flags);···125122 spin_unlock_irqrestore(&list_lock, flags);126123127124 if (needs_update)128128- update_irq_unlocked(mdp_kms);125125+ mdp_irq_update(mdp_kms);129126}130127131128void mdp_irq_unregister(struct mdp_kms *mdp_kms, struct mdp_irq *irq)···144141 spin_unlock_irqrestore(&list_lock, flags);145142146143 if (needs_update)147147- update_irq_unlocked(mdp_kms);144144+ mdp_irq_update(mdp_kms);148145}
···2323 struct drm_atomic_state *state;2424 uint32_t fence;2525 struct msm_fence_cb fence_cb;2626+ uint32_t crtc_mask;2627};27282829static void fence_cb(struct msm_fence_cb *cb);3030+3131+/* block until specified crtcs are no longer pending update, and3232+ * atomically mark them as pending update3333+ */3434+static int start_atomic(struct msm_drm_private *priv, uint32_t crtc_mask)3535+{3636+ int ret;3737+3838+ spin_lock(&priv->pending_crtcs_event.lock);3939+ ret = wait_event_interruptible_locked(priv->pending_crtcs_event,4040+ !(priv->pending_crtcs & crtc_mask));4141+ if (ret == 0) {4242+ DBG("start: %08x", crtc_mask);4343+ priv->pending_crtcs |= crtc_mask;4444+ }4545+ spin_unlock(&priv->pending_crtcs_event.lock);4646+4747+ return ret;4848+}4949+5050+/* clear specified crtcs (no longer pending update)5151+ */5252+static void end_atomic(struct msm_drm_private *priv, uint32_t crtc_mask)5353+{5454+ spin_lock(&priv->pending_crtcs_event.lock);5555+ DBG("end: %08x", crtc_mask);5656+ priv->pending_crtcs &= ~crtc_mask;5757+ wake_up_all_locked(&priv->pending_crtcs_event);5858+ spin_unlock(&priv->pending_crtcs_event.lock);5959+}29603061static struct msm_commit *new_commit(struct drm_atomic_state *state)3162{···89589059 drm_atomic_helper_commit_post_planes(dev, state);91606161+ /* NOTE: _wait_for_vblanks() only waits for vblank on6262+ * enabled CRTCs. So we end up faulting when disabling6363+ * due to (potentially) unref'ing the outgoing fb's6464+ * before the vblank when the disable has latched.6565+ *6666+ * But if it did wait on disabled (or newly disabled)6767+ * CRTCs, that would be racy (ie. we could have missed6868+ * the irq. We need some way to poll for pipe shut6969+ * down. Or just live with occasionally hitting the7070+ * timeout in the CRTC disable path (which really should7171+ * not be critical path)7272+ */7373+9274 drm_atomic_helper_wait_for_vblanks(dev, state);93759476 drm_atomic_helper_cleanup_planes(dev, state);95779678 drm_atomic_state_free(state);7979+8080+ end_atomic(dev->dev_private, c->crtc_mask);97819882 kfree(c);9983}···14397int msm_atomic_commit(struct drm_device *dev,14498 struct drm_atomic_state *state, bool async)14599{146146- struct msm_commit *c;147100 int nplanes = dev->mode_config.num_total_plane;101101+ int ncrtcs = dev->mode_config.num_crtc;102102+ struct msm_commit *c;148103 int i, ret;149104150105 ret = drm_atomic_helper_prepare_planes(dev, state);···153106 return ret;154107155108 c = new_commit(state);109109+ if (!c)110110+ return -ENOMEM;111111+112112+ /*113113+ * Figure out what crtcs we have:114114+ */115115+ for (i = 0; i < ncrtcs; i++) {116116+ struct drm_crtc *crtc = state->crtcs[i];117117+ if (!crtc)118118+ continue;119119+ c->crtc_mask |= (1 << drm_crtc_index(crtc));120120+ }156121157122 /*158123 * Figure out what fence to wait for:···179120 if ((plane->state->fb != new_state->fb) && new_state->fb)180121 add_fb(c, new_state->fb);181122 }123123+124124+ /*125125+ * Wait for pending updates on any of the same crtc's and then126126+ * mark our set of crtc's as busy:127127+ */128128+ ret = start_atomic(dev->dev_private, c->crtc_mask);129129+ if (ret)130130+ return ret;182131183132 /*184133 * This is the point of no return - everything below never fails except
···9696 /* callbacks deferred until bo is inactive: */9797 struct list_head fence_cbs;98989999+ /* crtcs pending async atomic updates: */100100+ uint32_t pending_crtcs;101101+ wait_queue_head_t pending_crtcs_event;102102+99103 /* registered MMUs: */100104 unsigned int num_mmus;101105 struct msm_mmu *mmus[NUM_DOMAINS];
+1-2
drivers/gpu/drm/msm/msm_fbdev.c
···190190fail:191191192192 if (ret) {193193- if (fbi)194194- framebuffer_release(fbi);193193+ framebuffer_release(fbi);195194 if (fb) {196195 drm_framebuffer_unregister_private(fb);197196 drm_framebuffer_remove(fb);
···2828#include "cikd.h"2929#include "cik_reg.h"3030#include "radeon_kfd.h"3131+#include "radeon_ucode.h"3232+#include <linux/firmware.h>31333234#define CIK_PIPE_PER_MEC (4)3335···5149static uint64_t get_gpu_clock_counter(struct kgd_dev *kgd);52505351static uint32_t get_max_engine_clock_in_mhz(struct kgd_dev *kgd);5252+static uint16_t get_fw_version(struct kgd_dev *kgd, enum kgd_engine_type type);54535554/*5655 * Register access functions···9491 .hqd_load = kgd_hqd_load,9592 .hqd_is_occupies = kgd_hqd_is_occupies,9693 .hqd_destroy = kgd_hqd_destroy,9494+ .get_fw_version = get_fw_version9795};98969997static const struct kgd2kfd_calls *kgd2kfd;···564560565561 release_queue(kgd);566562 return 0;563563+}564564+565565+static uint16_t get_fw_version(struct kgd_dev *kgd, enum kgd_engine_type type)566566+{567567+ struct radeon_device *rdev = (struct radeon_device *) kgd;568568+ const union radeon_firmware_header *hdr;569569+570570+ BUG_ON(kgd == NULL || rdev->mec_fw == NULL);571571+572572+ switch (type) {573573+ case KGD_ENGINE_PFP:574574+ hdr = (const union radeon_firmware_header *) rdev->pfp_fw->data;575575+ break;576576+577577+ case KGD_ENGINE_ME:578578+ hdr = (const union radeon_firmware_header *) rdev->me_fw->data;579579+ break;580580+581581+ case KGD_ENGINE_CE:582582+ hdr = (const union radeon_firmware_header *) rdev->ce_fw->data;583583+ break;584584+585585+ case KGD_ENGINE_MEC1:586586+ hdr = (const union radeon_firmware_header *) rdev->mec_fw->data;587587+ break;588588+589589+ case KGD_ENGINE_MEC2:590590+ hdr = (const union radeon_firmware_header *)591591+ rdev->mec2_fw->data;592592+ break;593593+594594+ case KGD_ENGINE_RLC:595595+ hdr = (const union radeon_firmware_header *) rdev->rlc_fw->data;596596+ break;597597+598598+ case KGD_ENGINE_SDMA:599599+ hdr = (const union radeon_firmware_header *)600600+ rdev->sdma_fw->data;601601+ break;602602+603603+ default:604604+ return 0;605605+ }606606+607607+ if (hdr == NULL)608608+ return 0;609609+610610+ /* Only 12 bit in use*/611611+ return hdr->common.ucode_version;567612}
-3
drivers/gpu/drm/radeon/radeon_object.c
···529529 u32 current_domain =530530 radeon_mem_type_to_domain(bo->tbo.mem.mem_type);531531532532- WARN_ONCE(bo->gem_base.dumb,533533- "GPU use of dumb buffer is illegal.\n");534534-535532 /* Check if this buffer will be moved and don't move it536533 * if we have moved too many buffers for this IB already.537534 *
+36-12
drivers/gpu/drm/tegra/dc.c
···168168 const struct tegra_dc_window *window)169169{170170 unsigned h_offset, v_offset, h_size, v_size, h_dda, v_dda, bpp;171171- unsigned long value;171171+ unsigned long value, flags;172172 bool yuv, planar;173173174174 /*···180180 bpp = window->bits_per_pixel / 8;181181 else182182 bpp = planar ? 1 : 2;183183+184184+ spin_lock_irqsave(&dc->lock, flags);183185184186 value = WINDOW_A_SELECT << index;185187 tegra_dc_writel(dc, value, DC_CMD_DISPLAY_WINDOW_HEADER);···275273276274 case TEGRA_BO_TILING_MODE_BLOCK:277275 DRM_ERROR("hardware doesn't support block linear mode\n");276276+ spin_unlock_irqrestore(&dc->lock, flags);278277 return -EINVAL;279278 }280279···334331335332 tegra_dc_window_commit(dc, index);336333334334+ spin_unlock_irqrestore(&dc->lock, flags);335335+337336 return 0;338337}339338···343338{344339 struct tegra_dc *dc = to_tegra_dc(plane->crtc);345340 struct tegra_plane *p = to_tegra_plane(plane);341341+ unsigned long flags;346342 u32 value;347343348344 if (!plane->crtc)349345 return 0;346346+347347+ spin_lock_irqsave(&dc->lock, flags);350348351349 value = WINDOW_A_SELECT << p->index;352350 tegra_dc_writel(dc, value, DC_CMD_DISPLAY_WINDOW_HEADER);···359351 tegra_dc_writel(dc, value, DC_WIN_WIN_OPTIONS);360352361353 tegra_dc_window_commit(dc, p->index);354354+355355+ spin_unlock_irqrestore(&dc->lock, flags);362356363357 return 0;364358}···709699 struct tegra_bo *bo = tegra_fb_get_plane(fb, 0);710700 unsigned int h_offset = 0, v_offset = 0;711701 struct tegra_bo_tiling tiling;702702+ unsigned long value, flags;712703 unsigned int format, swap;713713- unsigned long value;714704 int err;715705716706 err = tegra_fb_get_tiling(fb, &tiling);717707 if (err < 0)718708 return err;709709+710710+ spin_lock_irqsave(&dc->lock, flags);719711720712 tegra_dc_writel(dc, WINDOW_A_SELECT, DC_CMD_DISPLAY_WINDOW_HEADER);721713···764752765753 case TEGRA_BO_TILING_MODE_BLOCK:766754 DRM_ERROR("hardware doesn't support block linear mode\n");755755+ spin_unlock_irqrestore(&dc->lock, flags);767756 return -EINVAL;768757 }769758···790777 value = GENERAL_ACT_REQ | WIN_A_ACT_REQ;791778 tegra_dc_writel(dc, value << 8, DC_CMD_STATE_CONTROL);792779 tegra_dc_writel(dc, value, DC_CMD_STATE_CONTROL);780780+781781+ spin_unlock_irqrestore(&dc->lock, flags);793782794783 return 0;795784}···829814 unsigned long flags, base;830815 struct tegra_bo *bo;831816832832- if (!dc->event)817817+ spin_lock_irqsave(&drm->event_lock, flags);818818+819819+ if (!dc->event) {820820+ spin_unlock_irqrestore(&drm->event_lock, flags);833821 return;822822+ }834823835824 bo = tegra_fb_get_plane(crtc->primary->fb, 0);836825826826+ spin_lock_irqsave(&dc->lock, flags);827827+837828 /* check if new start address has been latched */829829+ tegra_dc_writel(dc, WINDOW_A_SELECT, DC_CMD_DISPLAY_WINDOW_HEADER);838830 tegra_dc_writel(dc, READ_MUX, DC_CMD_STATE_ACCESS);839831 base = tegra_dc_readl(dc, DC_WINBUF_START_ADDR);840832 tegra_dc_writel(dc, 0, DC_CMD_STATE_ACCESS);841833834834+ spin_unlock_irqrestore(&dc->lock, flags);835835+842836 if (base == bo->paddr + crtc->primary->fb->offsets[0]) {843843- spin_lock_irqsave(&drm->event_lock, flags);844844- drm_send_vblank_event(drm, dc->pipe, dc->event);845845- drm_vblank_put(drm, dc->pipe);837837+ drm_crtc_send_vblank_event(crtc, dc->event);838838+ drm_crtc_vblank_put(crtc);846839 dc->event = NULL;847847- spin_unlock_irqrestore(&drm->event_lock, flags);848840 }841841+842842+ spin_unlock_irqrestore(&drm->event_lock, flags);849843}850844851845void tegra_dc_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file)···867843868844 if (dc->event && dc->event->base.file_priv == file) {869845 dc->event->base.destroy(&dc->event->base);870870- drm_vblank_put(drm, dc->pipe);846846+ drm_crtc_vblank_put(crtc);871847 dc->event = NULL;872848 }873849···877853static int tegra_dc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,878854 struct drm_pending_vblank_event *event, uint32_t page_flip_flags)879855{856856+ unsigned int pipe = drm_crtc_index(crtc);880857 struct tegra_dc *dc = to_tegra_dc(crtc);881881- struct drm_device *drm = crtc->dev;882858883859 if (dc->event)884860 return -EBUSY;885861886862 if (event) {887887- event->pipe = dc->pipe;863863+ event->pipe = pipe;888864 dc->event = event;889889- drm_vblank_get(drm, dc->pipe);865865+ drm_crtc_vblank_get(crtc);890866 }891867892868 tegra_dc_set_base(dc, 0, 0, fb);···11511127 /*11521128 dev_dbg(dc->dev, "%s(): vertical blank\n", __func__);11531129 */11541154- drm_handle_vblank(dc->base.dev, dc->pipe);11301130+ drm_crtc_handle_vblank(&dc->base);11551131 tegra_dc_finish_page_flip(dc);11561132 }11571133
+10-6
drivers/gpu/drm/tegra/drm.c
···694694 .llseek = noop_llseek,695695};696696697697-static struct drm_crtc *tegra_crtc_from_pipe(struct drm_device *drm, int pipe)697697+static struct drm_crtc *tegra_crtc_from_pipe(struct drm_device *drm,698698+ unsigned int pipe)698699{699700 struct drm_crtc *crtc;700701701702 list_for_each_entry(crtc, &drm->mode_config.crtc_list, head) {702702- struct tegra_dc *dc = to_tegra_dc(crtc);703703-704704- if (dc->pipe == pipe)703703+ if (pipe == drm_crtc_index(crtc))705704 return crtc;706705 }707706708707 return NULL;709708}710709711711-static u32 tegra_drm_get_vblank_counter(struct drm_device *dev, int crtc)710710+static u32 tegra_drm_get_vblank_counter(struct drm_device *drm, int pipe)712711{712712+ struct drm_crtc *crtc = tegra_crtc_from_pipe(drm, pipe);713713+714714+ if (!crtc)715715+ return 0;716716+713717 /* TODO: implement real hardware counter using syncpoints */714714- return drm_vblank_count(dev, crtc);718718+ return drm_crtc_vblank_count(crtc);715719}716720717721static int tegra_drm_enable_vblank(struct drm_device *drm, int pipe)
+39-11
drivers/gpu/drm/tegra/gem.c
···216216 }217217}218218219219-static int tegra_bo_get_pages(struct drm_device *drm, struct tegra_bo *bo,220220- size_t size)219219+static int tegra_bo_get_pages(struct drm_device *drm, struct tegra_bo *bo)221220{221221+ struct scatterlist *s;222222+ struct sg_table *sgt;223223+ unsigned int i;224224+222225 bo->pages = drm_gem_get_pages(&bo->gem);223226 if (IS_ERR(bo->pages))224227 return PTR_ERR(bo->pages);225228226226- bo->num_pages = size >> PAGE_SHIFT;229229+ bo->num_pages = bo->gem.size >> PAGE_SHIFT;227230228228- bo->sgt = drm_prime_pages_to_sg(bo->pages, bo->num_pages);229229- if (IS_ERR(bo->sgt)) {230230- drm_gem_put_pages(&bo->gem, bo->pages, false, false);231231- return PTR_ERR(bo->sgt);231231+ sgt = drm_prime_pages_to_sg(bo->pages, bo->num_pages);232232+ if (IS_ERR(sgt))233233+ goto put_pages;234234+235235+ /*236236+ * Fake up the SG table so that dma_map_sg() can be used to flush the237237+ * pages associated with it. Note that this relies on the fact that238238+ * the DMA API doesn't hook into IOMMU on Tegra, therefore mapping is239239+ * only cache maintenance.240240+ *241241+ * TODO: Replace this by drm_clflash_sg() once it can be implemented242242+ * without relying on symbols that are not exported.243243+ */244244+ for_each_sg(sgt->sgl, s, sgt->nents, i)245245+ sg_dma_address(s) = sg_phys(s);246246+247247+ if (dma_map_sg(drm->dev, sgt->sgl, sgt->nents, DMA_TO_DEVICE) == 0) {248248+ sgt = ERR_PTR(-ENOMEM);249249+ goto release_sgt;232250 }233251252252+ bo->sgt = sgt;253253+234254 return 0;255255+256256+release_sgt:257257+ sg_free_table(sgt);258258+ kfree(sgt);259259+put_pages:260260+ drm_gem_put_pages(&bo->gem, bo->pages, false, false);261261+ return PTR_ERR(sgt);235262}236263237237-static int tegra_bo_alloc(struct drm_device *drm, struct tegra_bo *bo,238238- size_t size)264264+static int tegra_bo_alloc(struct drm_device *drm, struct tegra_bo *bo)239265{240266 struct tegra_drm *tegra = drm->dev_private;241267 int err;242268243269 if (tegra->domain) {244244- err = tegra_bo_get_pages(drm, bo, size);270270+ err = tegra_bo_get_pages(drm, bo);245271 if (err < 0)246272 return err;247273···277251 return err;278252 }279253 } else {254254+ size_t size = bo->gem.size;255255+280256 bo->vaddr = dma_alloc_writecombine(drm->dev, size, &bo->paddr,281257 GFP_KERNEL | __GFP_NOWARN);282258 if (!bo->vaddr) {···302274 if (IS_ERR(bo))303275 return bo;304276305305- err = tegra_bo_alloc(drm, bo, size);277277+ err = tegra_bo_alloc(drm, bo);306278 if (err < 0)307279 goto release;308280
+44-16
drivers/input/evdev.c
···2828#include <linux/cdev.h>2929#include "input-compat.h"30303131+enum evdev_clock_type {3232+ EV_CLK_REAL = 0,3333+ EV_CLK_MONO,3434+ EV_CLK_BOOT,3535+ EV_CLK_MAX3636+};3737+3138struct evdev {3239 int open;3340 struct input_handle handle;···5649 struct fasync_struct *fasync;5750 struct evdev *evdev;5851 struct list_head node;5959- int clkid;5252+ int clk_type;6053 bool revoked;6154 unsigned int bufsize;6255 struct input_event buffer[];6356};5757+5858+static int evdev_set_clk_type(struct evdev_client *client, unsigned int clkid)5959+{6060+ switch (clkid) {6161+6262+ case CLOCK_REALTIME:6363+ client->clk_type = EV_CLK_REAL;6464+ break;6565+ case CLOCK_MONOTONIC:6666+ client->clk_type = EV_CLK_MONO;6767+ break;6868+ case CLOCK_BOOTTIME:6969+ client->clk_type = EV_CLK_BOOT;7070+ break;7171+ default:7272+ return -EINVAL;7373+ }7474+7575+ return 0;7676+}64776578/* flush queued events of type @type, caller must hold client->buffer_lock */6679static void __evdev_flush_queue(struct evdev_client *client, unsigned int type)···135108 struct input_event ev;136109 ktime_t time;137110138138- time = (client->clkid == CLOCK_MONOTONIC) ?139139- ktime_get() : ktime_get_real();111111+ time = client->clk_type == EV_CLK_REAL ?112112+ ktime_get_real() :113113+ client->clk_type == EV_CLK_MONO ?114114+ ktime_get() :115115+ ktime_get_boottime();140116141117 ev.time = ktime_to_timeval(time);142118 ev.type = EV_SYN;···189159190160static void evdev_pass_values(struct evdev_client *client,191161 const struct input_value *vals, unsigned int count,192192- ktime_t mono, ktime_t real)162162+ ktime_t *ev_time)193163{194164 struct evdev *evdev = client->evdev;195165 const struct input_value *v;···199169 if (client->revoked)200170 return;201171202202- event.time = ktime_to_timeval(client->clkid == CLOCK_MONOTONIC ?203203- mono : real);172172+ event.time = ktime_to_timeval(ev_time[client->clk_type]);204173205174 /* Interrupts are disabled, just acquire the lock. */206175 spin_lock(&client->buffer_lock);···227198{228199 struct evdev *evdev = handle->private;229200 struct evdev_client *client;230230- ktime_t time_mono, time_real;201201+ ktime_t ev_time[EV_CLK_MAX];231202232232- time_mono = ktime_get();233233- time_real = ktime_mono_to_real(time_mono);203203+ ev_time[EV_CLK_MONO] = ktime_get();204204+ ev_time[EV_CLK_REAL] = ktime_mono_to_real(ev_time[EV_CLK_MONO]);205205+ ev_time[EV_CLK_BOOT] = ktime_mono_to_any(ev_time[EV_CLK_MONO],206206+ TK_OFFS_BOOT);234207235208 rcu_read_lock();236209237210 client = rcu_dereference(evdev->grab);238211239212 if (client)240240- evdev_pass_values(client, vals, count, time_mono, time_real);213213+ evdev_pass_values(client, vals, count, ev_time);241214 else242215 list_for_each_entry_rcu(client, &evdev->client_list, node)243243- evdev_pass_values(client, vals, count,244244- time_mono, time_real);216216+ evdev_pass_values(client, vals, count, ev_time);245217246218 rcu_read_unlock();247219}···907877 case EVIOCSCLOCKID:908878 if (copy_from_user(&i, p, sizeof(unsigned int)))909879 return -EFAULT;910910- if (i != CLOCK_MONOTONIC && i != CLOCK_REALTIME)911911- return -EINVAL;912912- client->clkid = i;913913- return 0;880880+881881+ return evdev_set_clk_type(client, i);914882915883 case EVIOCGKEYCODE:916884 return evdev_handle_get_keycode(dev, p);
+13-9
drivers/input/input.c
···1974197419751975 events = mt_slots + 1; /* count SYN_MT_REPORT and SYN_REPORT */1976197619771977- for (i = 0; i < ABS_CNT; i++) {19781978- if (test_bit(i, dev->absbit)) {19791979- if (input_is_mt_axis(i))19801980- events += mt_slots;19811981- else19821982- events++;19771977+ if (test_bit(EV_ABS, dev->evbit)) {19781978+ for (i = 0; i < ABS_CNT; i++) {19791979+ if (test_bit(i, dev->absbit)) {19801980+ if (input_is_mt_axis(i))19811981+ events += mt_slots;19821982+ else19831983+ events++;19841984+ }19831985 }19841986 }1985198719861986- for (i = 0; i < REL_CNT; i++)19871987- if (test_bit(i, dev->relbit))19881988- events++;19881988+ if (test_bit(EV_REL, dev->evbit)) {19891989+ for (i = 0; i < REL_CNT; i++)19901990+ if (test_bit(i, dev->relbit))19911991+ events++;19921992+ }1989199319901994 /* Make room for KEY and MSC events */19911995 events += 7;
+1
drivers/input/keyboard/Kconfig
···559559config KEYBOARD_STMPE560560 tristate "STMPE keypad support"561561 depends on MFD_STMPE562562+ depends on OF562563 select INPUT_MATRIXKMAP563564 help564565 Say Y here if you want to use the keypad controller on STMPE I/O
+57-57
drivers/input/keyboard/gpio_keys.c
···3535struct gpio_button_data {3636 const struct gpio_keys_button *button;3737 struct input_dev *input;3838- struct timer_list timer;3939- struct work_struct work;4040- unsigned int timer_debounce; /* in msecs */3838+3939+ struct timer_list release_timer;4040+ unsigned int release_delay; /* in msecs, for IRQ-only buttons */4141+4242+ struct delayed_work work;4343+ unsigned int software_debounce; /* in msecs, for GPIO-driven buttons */4444+4145 unsigned int irq;4246 spinlock_t lock;4347 bool disabled;···120116{121117 if (!bdata->disabled) {122118 /*123123- * Disable IRQ and possible debouncing timer.119119+ * Disable IRQ and associated timer/work structure.124120 */125121 disable_irq(bdata->irq);126126- if (bdata->timer_debounce)127127- del_timer_sync(&bdata->timer);122122+123123+ if (gpio_is_valid(bdata->button->gpio))124124+ cancel_delayed_work_sync(&bdata->work);125125+ else126126+ del_timer_sync(&bdata->release_timer);128127129128 bdata->disabled = true;130129 }···350343static void gpio_keys_gpio_work_func(struct work_struct *work)351344{352345 struct gpio_button_data *bdata =353353- container_of(work, struct gpio_button_data, work);346346+ container_of(work, struct gpio_button_data, work.work);354347355348 gpio_keys_gpio_report_event(bdata);356349357350 if (bdata->button->wakeup)358351 pm_relax(bdata->input->dev.parent);359359-}360360-361361-static void gpio_keys_gpio_timer(unsigned long _data)362362-{363363- struct gpio_button_data *bdata = (struct gpio_button_data *)_data;364364-365365- schedule_work(&bdata->work);366352}367353368354static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id)···366366367367 if (bdata->button->wakeup)368368 pm_stay_awake(bdata->input->dev.parent);369369- if (bdata->timer_debounce)370370- mod_timer(&bdata->timer,371371- jiffies + msecs_to_jiffies(bdata->timer_debounce));372372- else373373- schedule_work(&bdata->work);369369+370370+ mod_delayed_work(system_wq,371371+ &bdata->work,372372+ msecs_to_jiffies(bdata->software_debounce));374373375374 return IRQ_HANDLED;376375}···407408 input_event(input, EV_KEY, button->code, 1);408409 input_sync(input);409410410410- if (!bdata->timer_debounce) {411411+ if (!bdata->release_delay) {411412 input_event(input, EV_KEY, button->code, 0);412413 input_sync(input);413414 goto out;···416417 bdata->key_pressed = true;417418 }418419419419- if (bdata->timer_debounce)420420- mod_timer(&bdata->timer,421421- jiffies + msecs_to_jiffies(bdata->timer_debounce));420420+ if (bdata->release_delay)421421+ mod_timer(&bdata->release_timer,422422+ jiffies + msecs_to_jiffies(bdata->release_delay));422423out:423424 spin_unlock_irqrestore(&bdata->lock, flags);424425 return IRQ_HANDLED;···428429{429430 struct gpio_button_data *bdata = data;430431431431- if (bdata->timer_debounce)432432- del_timer_sync(&bdata->timer);433433-434434- cancel_work_sync(&bdata->work);432432+ if (gpio_is_valid(bdata->button->gpio))433433+ cancel_delayed_work_sync(&bdata->work);434434+ else435435+ del_timer_sync(&bdata->release_timer);435436}436437437438static int gpio_keys_setup_key(struct platform_device *pdev,···465466 button->debounce_interval * 1000);466467 /* use timer if gpiolib doesn't provide debounce */467468 if (error < 0)468468- bdata->timer_debounce =469469+ bdata->software_debounce =469470 button->debounce_interval;470471 }471472472472- irq = gpio_to_irq(button->gpio);473473- if (irq < 0) {474474- error = irq;475475- dev_err(dev,476476- "Unable to get irq number for GPIO %d, error %d\n",477477- button->gpio, error);478478- return error;473473+ if (button->irq) {474474+ bdata->irq = button->irq;475475+ } else {476476+ irq = gpio_to_irq(button->gpio);477477+ if (irq < 0) {478478+ error = irq;479479+ dev_err(dev,480480+ "Unable to get irq number for GPIO %d, error %d\n",481481+ button->gpio, error);482482+ return error;483483+ }484484+ bdata->irq = irq;479485 }480480- bdata->irq = irq;481486482482- INIT_WORK(&bdata->work, gpio_keys_gpio_work_func);483483- setup_timer(&bdata->timer,484484- gpio_keys_gpio_timer, (unsigned long)bdata);487487+ INIT_DELAYED_WORK(&bdata->work, gpio_keys_gpio_work_func);485488486489 isr = gpio_keys_gpio_isr;487490 irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;···500499 return -EINVAL;501500 }502501503503- bdata->timer_debounce = button->debounce_interval;504504- setup_timer(&bdata->timer,502502+ bdata->release_delay = button->debounce_interval;503503+ setup_timer(&bdata->release_timer,505504 gpio_keys_irq_timer, (unsigned long)bdata);506505507506 isr = gpio_keys_irq_isr;···511510 input_set_capability(input, button->type ?: EV_KEY, button->code);512511513512 /*514514- * Install custom action to cancel debounce timer and513513+ * Install custom action to cancel release timer and515514 * workqueue item.516515 */517516 error = devm_add_action(&pdev->dev, gpio_keys_quiesce_key, bdata);···619618620619 i = 0;621620 for_each_child_of_node(node, pp) {622622- int gpio = -1;623621 enum of_gpio_flags flags;624622625623 button = &pdata->buttons[i++];626624627627- if (!of_find_property(pp, "gpios", NULL)) {628628- button->irq = irq_of_parse_and_map(pp, 0);629629- if (button->irq == 0) {630630- i--;631631- pdata->nbuttons--;632632- dev_warn(dev, "Found button without gpios or irqs\n");633633- continue;634634- }635635- } else {636636- gpio = of_get_gpio_flags(pp, 0, &flags);637637- if (gpio < 0) {638638- error = gpio;625625+ button->gpio = of_get_gpio_flags(pp, 0, &flags);626626+ if (button->gpio < 0) {627627+ error = button->gpio;628628+ if (error != -ENOENT) {639629 if (error != -EPROBE_DEFER)640630 dev_err(dev,641631 "Failed to get gpio flags, error: %d\n",642632 error);643633 return ERR_PTR(error);644634 }635635+ } else {636636+ button->active_low = flags & OF_GPIO_ACTIVE_LOW;645637 }646638647647- button->gpio = gpio;648648- button->active_low = flags & OF_GPIO_ACTIVE_LOW;639639+ button->irq = irq_of_parse_and_map(pp, 0);640640+641641+ if (!gpio_is_valid(button->gpio) && !button->irq) {642642+ dev_err(dev, "Found button without gpios or irqs\n");643643+ return ERR_PTR(-EINVAL);644644+ }649645650646 if (of_property_read_u32(pp, "linux,code", &button->code)) {651647 dev_err(dev, "Button without keycode: 0x%x\n",···656658 button->type = EV_KEY;657659658660 button->wakeup = !!of_get_property(pp, "gpio-key,wakeup", NULL);661661+662662+ button->can_disable = !!of_get_property(pp, "linux,can-disable", NULL);659663660664 if (of_property_read_u32(pp, "debounce-interval",661665 &button->debounce_interval))
···4545#define STMPE_KEYPAD_MAX_ROWS 84646#define STMPE_KEYPAD_MAX_COLS 84747#define STMPE_KEYPAD_ROW_SHIFT 34848-#define STMPE_KEYPAD_KEYMAP_SIZE \4848+#define STMPE_KEYPAD_KEYMAP_MAX_SIZE \4949 (STMPE_KEYPAD_MAX_ROWS * STMPE_KEYPAD_MAX_COLS)50505151/**5252 * struct stmpe_keypad_variant - model-specific attributes5353 * @auto_increment: whether the KPC_DATA_BYTE register address5454 * auto-increments on multiple read5555+ * @set_pullup: whether the pins need to have their pull-ups set5556 * @num_data: number of data bytes5657 * @num_normal_data: number of normal keys' data bytes5758 * @max_cols: maximum number of columns supported···6261 */6362struct stmpe_keypad_variant {6463 bool auto_increment;6464+ bool set_pullup;6565 int num_data;6666 int num_normal_data;6767 int max_cols;···8381 },8482 [STMPE2401] = {8583 .auto_increment = false,8484+ .set_pullup = true,8685 .num_data = 3,8786 .num_normal_data = 2,8887 .max_cols = 8,···9390 },9491 [STMPE2403] = {9592 .auto_increment = true,9393+ .set_pullup = true,9694 .num_data = 5,9795 .num_normal_data = 3,9896 .max_cols = 8,···10399 },104100};105101102102+/**103103+ * struct stmpe_keypad - STMPE keypad state container104104+ * @stmpe: pointer to parent STMPE device105105+ * @input: spawned input device106106+ * @variant: STMPE variant107107+ * @debounce_ms: debounce interval, in ms. Maximum is108108+ * %STMPE_KEYPAD_MAX_DEBOUNCE.109109+ * @scan_count: number of key scanning cycles to confirm key data.110110+ * Maximum is %STMPE_KEYPAD_MAX_SCAN_COUNT.111111+ * @no_autorepeat: disable key autorepeat112112+ * @rows: bitmask for the rows113113+ * @cols: bitmask for the columns114114+ * @keymap: the keymap115115+ */106116struct stmpe_keypad {107117 struct stmpe *stmpe;108118 struct input_dev *input;109119 const struct stmpe_keypad_variant *variant;110110- const struct stmpe_keypad_platform_data *plat;111111-120120+ unsigned int debounce_ms;121121+ unsigned int scan_count;122122+ bool no_autorepeat;112123 unsigned int rows;113124 unsigned int cols;114114-115115- unsigned short keymap[STMPE_KEYPAD_KEYMAP_SIZE];125125+ unsigned short keymap[STMPE_KEYPAD_KEYMAP_MAX_SIZE];116126};117127118128static int stmpe_keypad_read_data(struct stmpe_keypad *keypad, u8 *data)···189171 unsigned int col_gpios = variant->col_gpios;190172 unsigned int row_gpios = variant->row_gpios;191173 struct stmpe *stmpe = keypad->stmpe;174174+ u8 pureg = stmpe->regs[STMPE_IDX_GPPUR_LSB];192175 unsigned int pins = 0;176176+ unsigned int pu_pins = 0;177177+ int ret;193178 int i;194179195180 /*···209188 for (i = 0; i < variant->max_cols; i++) {210189 int num = __ffs(col_gpios);211190212212- if (keypad->cols & (1 << i))191191+ if (keypad->cols & (1 << i)) {213192 pins |= 1 << num;193193+ pu_pins |= 1 << num;194194+ }214195215196 col_gpios &= ~(1 << num);216197 }···226203 row_gpios &= ~(1 << num);227204 }228205229229- return stmpe_set_altfunc(stmpe, pins, STMPE_BLOCK_KEYPAD);206206+ ret = stmpe_set_altfunc(stmpe, pins, STMPE_BLOCK_KEYPAD);207207+ if (ret)208208+ return ret;209209+210210+ /*211211+ * On STMPE24xx, set pin bias to pull-up on all keypad input212212+ * pins (columns), this incidentally happen to be maximum 8 pins213213+ * and placed at GPIO0-7 so only the LSB of the pull up register214214+ * ever needs to be written.215215+ */216216+ if (variant->set_pullup) {217217+ u8 val;218218+219219+ ret = stmpe_reg_read(stmpe, pureg);220220+ if (ret)221221+ return ret;222222+223223+ /* Do not touch unused pins, may be used for GPIO */224224+ val = ret & ~pu_pins;225225+ val |= pu_pins;226226+227227+ ret = stmpe_reg_write(stmpe, pureg, val);228228+ }229229+230230+ return 0;230231}231232232233static int stmpe_keypad_chip_init(struct stmpe_keypad *keypad)233234{234234- const struct stmpe_keypad_platform_data *plat = keypad->plat;235235 const struct stmpe_keypad_variant *variant = keypad->variant;236236 struct stmpe *stmpe = keypad->stmpe;237237 int ret;238238239239- if (plat->debounce_ms > STMPE_KEYPAD_MAX_DEBOUNCE)239239+ if (keypad->debounce_ms > STMPE_KEYPAD_MAX_DEBOUNCE)240240 return -EINVAL;241241242242- if (plat->scan_count > STMPE_KEYPAD_MAX_SCAN_COUNT)242242+ if (keypad->scan_count > STMPE_KEYPAD_MAX_SCAN_COUNT)243243 return -EINVAL;244244245245 ret = stmpe_enable(stmpe, STMPE_BLOCK_KEYPAD);···291245292246 ret = stmpe_set_bits(stmpe, STMPE_KPC_CTRL_MSB,293247 STMPE_KPC_CTRL_MSB_SCAN_COUNT,294294- plat->scan_count << 4);248248+ keypad->scan_count << 4);295249 if (ret < 0)296250 return ret;297251···299253 STMPE_KPC_CTRL_LSB_SCAN |300254 STMPE_KPC_CTRL_LSB_DEBOUNCE,301255 STMPE_KPC_CTRL_LSB_SCAN |302302- (plat->debounce_ms << 1));256256+ (keypad->debounce_ms << 1));303257}304258305305-static void stmpe_keypad_fill_used_pins(struct stmpe_keypad *keypad)259259+static void stmpe_keypad_fill_used_pins(struct stmpe_keypad *keypad,260260+ u32 used_rows, u32 used_cols)306261{307262 int row, col;308263309309- for (row = 0; row < STMPE_KEYPAD_MAX_ROWS; row++) {310310- for (col = 0; col < STMPE_KEYPAD_MAX_COLS; col++) {264264+ for (row = 0; row < used_rows; row++) {265265+ for (col = 0; col < used_cols; col++) {311266 int code = MATRIX_SCAN_CODE(row, col,312312- STMPE_KEYPAD_ROW_SHIFT);267267+ STMPE_KEYPAD_ROW_SHIFT);313268 if (keypad->keymap[code] != KEY_RESERVED) {314269 keypad->rows |= 1 << row;315270 keypad->cols |= 1 << col;···319272 }320273}321274322322-#ifdef CONFIG_OF323323-static const struct stmpe_keypad_platform_data *324324-stmpe_keypad_of_probe(struct device *dev)325325-{326326- struct device_node *np = dev->of_node;327327- struct stmpe_keypad_platform_data *plat;328328-329329- if (!np)330330- return ERR_PTR(-ENODEV);331331-332332- plat = devm_kzalloc(dev, sizeof(*plat), GFP_KERNEL);333333- if (!plat)334334- return ERR_PTR(-ENOMEM);335335-336336- of_property_read_u32(np, "debounce-interval", &plat->debounce_ms);337337- of_property_read_u32(np, "st,scan-count", &plat->scan_count);338338-339339- plat->no_autorepeat = of_property_read_bool(np, "st,no-autorepeat");340340-341341- return plat;342342-}343343-#else344344-static inline const struct stmpe_keypad_platform_data *345345-stmpe_keypad_of_probe(struct device *dev)346346-{347347- return ERR_PTR(-EINVAL);348348-}349349-#endif350350-351275static int stmpe_keypad_probe(struct platform_device *pdev)352276{353277 struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent);354354- const struct stmpe_keypad_platform_data *plat;278278+ struct device_node *np = pdev->dev.of_node;355279 struct stmpe_keypad *keypad;356280 struct input_dev *input;281281+ u32 rows;282282+ u32 cols;357283 int error;358284 int irq;359359-360360- plat = stmpe->pdata->keypad;361361- if (!plat) {362362- plat = stmpe_keypad_of_probe(&pdev->dev);363363- if (IS_ERR(plat))364364- return PTR_ERR(plat);365365- }366285367286 irq = platform_get_irq(pdev, 0);368287 if (irq < 0)···339326 if (!keypad)340327 return -ENOMEM;341328329329+ keypad->stmpe = stmpe;330330+ keypad->variant = &stmpe_keypad_variants[stmpe->partnum];331331+332332+ of_property_read_u32(np, "debounce-interval", &keypad->debounce_ms);333333+ of_property_read_u32(np, "st,scan-count", &keypad->scan_count);334334+ keypad->no_autorepeat = of_property_read_bool(np, "st,no-autorepeat");335335+342336 input = devm_input_allocate_device(&pdev->dev);343337 if (!input)344338 return -ENOMEM;···354334 input->id.bustype = BUS_I2C;355335 input->dev.parent = &pdev->dev;356336357357- error = matrix_keypad_build_keymap(plat->keymap_data, NULL,358358- STMPE_KEYPAD_MAX_ROWS,359359- STMPE_KEYPAD_MAX_COLS,337337+ error = matrix_keypad_parse_of_params(&pdev->dev, &rows, &cols);338338+ if (error)339339+ return error;340340+341341+ error = matrix_keypad_build_keymap(NULL, NULL, rows, cols,360342 keypad->keymap, input);361343 if (error)362344 return error;363345364346 input_set_capability(input, EV_MSC, MSC_SCAN);365365- if (!plat->no_autorepeat)347347+ if (!keypad->no_autorepeat)366348 __set_bit(EV_REP, input->evbit);367349368368- stmpe_keypad_fill_used_pins(keypad);350350+ stmpe_keypad_fill_used_pins(keypad, rows, cols);369351370370- keypad->stmpe = stmpe;371371- keypad->plat = plat;372352 keypad->input = input;373373- keypad->variant = &stmpe_keypad_variants[stmpe->partnum];374353375354 error = stmpe_keypad_chip_init(keypad);376355 if (error < 0)
+74-10
drivers/input/mouse/alps.c
···881881 unsigned char *pkt,882882 unsigned char pkt_id)883883{884884+ /*885885+ * packet-fmt b7 b6 b5 b4 b3 b2 b1 b0886886+ * Byte0 TWO & MULTI L 1 R M 1 Y0-2 Y0-1 Y0-0887887+ * Byte0 NEW L 1 X1-5 1 1 Y0-2 Y0-1 Y0-0888888+ * Byte1 Y0-10 Y0-9 Y0-8 Y0-7 Y0-6 Y0-5 Y0-4 Y0-3889889+ * Byte2 X0-11 1 X0-10 X0-9 X0-8 X0-7 X0-6 X0-5890890+ * Byte3 X1-11 1 X0-4 X0-3 1 X0-2 X0-1 X0-0891891+ * Byte4 TWO X1-10 TWO X1-9 X1-8 X1-7 X1-6 X1-5 X1-4892892+ * Byte4 MULTI X1-10 TWO X1-9 X1-8 X1-7 X1-6 Y1-5 1893893+ * Byte4 NEW X1-10 TWO X1-9 X1-8 X1-7 X1-6 0 0894894+ * Byte5 TWO & NEW Y1-10 0 Y1-9 Y1-8 Y1-7 Y1-6 Y1-5 Y1-4895895+ * Byte5 MULTI Y1-10 0 Y1-9 Y1-8 Y1-7 Y1-6 F-1 F-0896896+ * L: Left button897897+ * R / M: Non-clickpads: Right / Middle button898898+ * Clickpads: When > 2 fingers are down, and some fingers899899+ * are in the button area, then the 2 coordinates reported900900+ * are for fingers outside the button area and these report901901+ * extra fingers being present in the right / left button902902+ * area. Note these fingers are not added to the F field!903903+ * so if a TWO packet is received and R = 1 then there are904904+ * 3 fingers down, etc.905905+ * TWO: 1: Two touches present, byte 0/4/5 are in TWO fmt906906+ * 0: If byte 4 bit 0 is 1, then byte 0/4/5 are in MULTI fmt907907+ * otherwise byte 0 bit 4 must be set and byte 0/4/5 are908908+ * in NEW fmt909909+ * F: Number of fingers - 3, 0 means 3 fingers, 1 means 4 ...910910+ */911911+884912 mt[0].x = ((pkt[2] & 0x80) << 4);885913 mt[0].x |= ((pkt[2] & 0x3F) << 5);886914 mt[0].x |= ((pkt[3] & 0x30) >> 1);···947919948920static int alps_get_mt_count(struct input_mt_pos *mt)949921{950950- int i;922922+ int i, fingers = 0;951923952952- for (i = 0; i < MAX_TOUCHES && mt[i].x != 0 && mt[i].y != 0; i++)953953- /* empty */;924924+ for (i = 0; i < MAX_TOUCHES; i++) {925925+ if (mt[i].x != 0 || mt[i].y != 0)926926+ fingers++;927927+ }954928955955- return i;929929+ return fingers;956930}957931958932static int alps_decode_packet_v7(struct alps_fields *f,959933 unsigned char *p,960934 struct psmouse *psmouse)961935{936936+ struct alps_data *priv = psmouse->private;962937 unsigned char pkt_id;963938964939 pkt_id = alps_get_packet_id_v7(p);···969938 return 0;970939 if (pkt_id == V7_PACKET_ID_UNKNOWN)971940 return -1;941941+ /*942942+ * NEW packets are send to indicate a discontinuity in the finger943943+ * coordinate reporting. Specifically a finger may have moved from944944+ * slot 0 to 1 or vice versa. INPUT_MT_TRACK takes care of this for945945+ * us.946946+ *947947+ * NEW packets have 3 problems:948948+ * 1) They do not contain middle / right button info (on non clickpads)949949+ * this can be worked around by preserving the old button state950950+ * 2) They do not contain an accurate fingercount, and they are951951+ * typically send when the number of fingers changes. We cannot use952952+ * the old finger count as that may mismatch with the amount of953953+ * touch coordinates we've available in the NEW packet954954+ * 3) Their x data for the second touch is inaccurate leading to955955+ * a possible jump of the x coordinate by 16 units when the first956956+ * non NEW packet comes in957957+ * Since problems 2 & 3 cannot be worked around, just ignore them.958958+ */959959+ if (pkt_id == V7_PACKET_ID_NEW)960960+ return 1;972961973962 alps_get_finger_coordinate_v7(f->mt, p, pkt_id);974963975975- if (pkt_id == V7_PACKET_ID_TWO || pkt_id == V7_PACKET_ID_MULTI) {976976- f->left = (p[0] & 0x80) >> 7;964964+ if (pkt_id == V7_PACKET_ID_TWO)965965+ f->fingers = alps_get_mt_count(f->mt);966966+ else /* pkt_id == V7_PACKET_ID_MULTI */967967+ f->fingers = 3 + (p[5] & 0x03);968968+969969+ f->left = (p[0] & 0x80) >> 7;970970+ if (priv->flags & ALPS_BUTTONPAD) {971971+ if (p[0] & 0x20)972972+ f->fingers++;973973+ if (p[0] & 0x10)974974+ f->fingers++;975975+ } else {977976 f->right = (p[0] & 0x20) >> 5;978977 f->middle = (p[0] & 0x10) >> 4;979978 }980979981981- if (pkt_id == V7_PACKET_ID_TWO)982982- f->fingers = alps_get_mt_count(f->mt);983983- else if (pkt_id == V7_PACKET_ID_MULTI)984984- f->fingers = 3 + (p[5] & 0x03);980980+ /* Sometimes a single touch is reported in mt[1] rather then mt[0] */981981+ if (f->fingers == 1 && f->mt[0].x == 0 && f->mt[0].y == 0) {982982+ f->mt[0].x = f->mt[1].x;983983+ f->mt[0].y = f->mt[1].y;984984+ f->mt[1].x = 0;985985+ f->mt[1].y = 0;986986+ }985987986988 return 0;987989}
···886886 unsigned idx, bus_width = 0;887887 int err = 0;888888889889- if (!mmc_can_ext_csd(card) &&889889+ if (!mmc_can_ext_csd(card) ||890890 !(host->caps & (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)))891891 return 0;892892
+1-1
drivers/net/bonding/bond_main.c
···16481648 /* slave is not a slave or master is not master of this slave */16491649 if (!(slave_dev->flags & IFF_SLAVE) ||16501650 !netdev_has_upper_dev(slave_dev, bond_dev)) {16511651- netdev_err(bond_dev, "cannot release %s\n",16511651+ netdev_dbg(bond_dev, "cannot release %s\n",16521652 slave_dev->name);16531653 return -EINVAL;16541654 }
···156156source "drivers/net/ethernet/renesas/Kconfig"157157source "drivers/net/ethernet/rdc/Kconfig"158158source "drivers/net/ethernet/rocker/Kconfig"159159-160160-config S6GMAC161161- tristate "S6105 GMAC ethernet support"162162- depends on XTENSA_VARIANT_S6000163163- select PHYLIB164164- ---help---165165- This driver supports the on chip ethernet device on the166166- S6105 xtensa processor.167167-168168- To compile this driver as a module, choose M here. The module169169- will be called s6gmac.170170-171159source "drivers/net/ethernet/samsung/Kconfig"172160source "drivers/net/ethernet/seeq/Kconfig"173161source "drivers/net/ethernet/silan/Kconfig"
···1780017800 goto err_out_apeunmap;1780117801 }17802178021780317803- /*1780417804- * Reset chip in case UNDI or EFI driver did not shutdown1780517805- * DMA self test will enable WDMAC and we'll see (spurious)1780617806- * pending DMA on the PCI bus at that point.1780717807- */1780817808- if ((tr32(HOSTCC_MODE) & HOSTCC_MODE_ENABLE) ||1780917809- (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) {1781017810- tw32(MEMARB_MODE, MEMARB_MODE_ENABLE);1781117811- tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);1781217812- }1781317813-1781417814- err = tg3_test_dma(tp);1781517815- if (err) {1781617816- dev_err(&pdev->dev, "DMA engine test failed, aborting\n");1781717817- goto err_out_apeunmap;1781817818- }1781917819-1782017803 intmbx = MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW;1782117804 rcvmbx = MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW;1782217805 sndmbx = MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW;···1784217859 sndmbx -= 0x4;1784317860 else1784417861 sndmbx += 0xc;1786217862+ }1786317863+1786417864+ /*1786517865+ * Reset chip in case UNDI or EFI driver did not shutdown1786617866+ * DMA self test will enable WDMAC and we'll see (spurious)1786717867+ * pending DMA on the PCI bus at that point.1786817868+ */1786917869+ if ((tr32(HOSTCC_MODE) & HOSTCC_MODE_ENABLE) ||1787017870+ (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) {1787117871+ tw32(MEMARB_MODE, MEMARB_MODE_ENABLE);1787217872+ tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);1787317873+ }1787417874+1787517875+ err = tg3_test_dma(tp);1787617876+ if (err) {1787717877+ dev_err(&pdev->dev, "DMA engine test failed, aborting\n");1787817878+ goto err_out_apeunmap;1784517879 }17846178801784717881 tg3_init_coal(tp);
+1-1
drivers/net/ethernet/brocade/bna/bnad_debugfs.c
···172172173173 /* Retrieve flash partition info */174174 fcomp.comp_status = 0;175175- init_completion(&fcomp.comp);175175+ reinit_completion(&fcomp.comp);176176 spin_lock_irqsave(&bnad->bna_lock, flags);177177 ret = bfa_nw_flash_get_attr(&bnad->bna.flash, &drvinfo->flash_attr,178178 bnad_cb_completion, &fcomp);
+4
drivers/net/ethernet/chelsio/cxgb4vf/adapter.h
···9696 s16 xact_addr_filt; /* index of our MAC address filter */9797 u16 rss_size; /* size of VI's RSS table slice */9898 u8 pidx; /* index into adapter port[] */9999+ s8 mdio_addr;100100+ u8 port_type; /* firmware port type */101101+ u8 mod_type; /* firmware module type */99102 u8 port_id; /* physical port ID */100103 u8 nqsets; /* # of "Queue Sets" */101104 u8 first_qset; /* index of first "Queue Set" */···525522 * is "contracted" to provide for the common code.526523 */527524void t4vf_os_link_changed(struct adapter *, int, int);525525+void t4vf_os_portmod_changed(struct adapter *, int);528526529527/*530528 * SGE function prototype declarations.
···245245 return a & 0x3f;246246}247247248248+#define ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\249249+ FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_40G | \250250+ FW_PORT_CAP_SPEED_100G | FW_PORT_CAP_ANEG)251251+248252/**249253 * init_link_config - initialize a link's SW state250254 * @lc: structure holding the link state···263259 lc->requested_speed = 0;264260 lc->speed = 0;265261 lc->requested_fc = lc->fc = PAUSE_RX | PAUSE_TX;266266- if (lc->supported & SUPPORTED_Autoneg) {267267- lc->advertising = lc->supported;262262+ if (lc->supported & FW_PORT_CAP_ANEG) {263263+ lc->advertising = lc->supported & ADVERT_MASK;268264 lc->autoneg = AUTONEG_ENABLE;269265 lc->requested_fc |= PAUSE_AUTONEG;270266 } else {···284280 struct fw_vi_cmd vi_cmd, vi_rpl;285281 struct fw_port_cmd port_cmd, port_rpl;286282 int v;287287- u32 word;288283289284 /*290285 * Execute a VI Read command to get our Virtual Interface information···322319 if (v)323320 return v;324321325325- v = 0;326326- word = be16_to_cpu(port_rpl.u.info.pcap);327327- if (word & FW_PORT_CAP_SPEED_100M)328328- v |= SUPPORTED_100baseT_Full;329329- if (word & FW_PORT_CAP_SPEED_1G)330330- v |= SUPPORTED_1000baseT_Full;331331- if (word & FW_PORT_CAP_SPEED_10G)332332- v |= SUPPORTED_10000baseT_Full;333333- if (word & FW_PORT_CAP_SPEED_40G)334334- v |= SUPPORTED_40000baseSR4_Full;335335- if (word & FW_PORT_CAP_ANEG)336336- v |= SUPPORTED_Autoneg;337337- init_link_config(&pi->link_cfg, v);322322+ v = be32_to_cpu(port_rpl.u.info.lstatus_to_modtype);323323+ pi->port_type = FW_PORT_CMD_PTYPE_G(v);324324+ pi->mod_type = FW_PORT_MOD_TYPE_NA;325325+326326+ init_link_config(&pi->link_cfg, be16_to_cpu(port_rpl.u.info.pcap));338327339328 return 0;340329}···14861491 */14871492 const struct fw_port_cmd *port_cmd =14881493 (const struct fw_port_cmd *)rpl;14891489- u32 word;14941494+ u32 stat, mod;14901495 int action, port_id, link_ok, speed, fc, pidx;1491149614921497 /*···15041509 port_id = FW_PORT_CMD_PORTID_G(15051510 be32_to_cpu(port_cmd->op_to_portid));1506151115071507- word = be32_to_cpu(port_cmd->u.info.lstatus_to_modtype);15081508- link_ok = (word & FW_PORT_CMD_LSTATUS_F) != 0;15121512+ stat = be32_to_cpu(port_cmd->u.info.lstatus_to_modtype);15131513+ link_ok = (stat & FW_PORT_CMD_LSTATUS_F) != 0;15091514 speed = 0;15101515 fc = 0;15111511- if (word & FW_PORT_CMD_RXPAUSE_F)15161516+ if (stat & FW_PORT_CMD_RXPAUSE_F)15121517 fc |= PAUSE_RX;15131513- if (word & FW_PORT_CMD_TXPAUSE_F)15181518+ if (stat & FW_PORT_CMD_TXPAUSE_F)15141519 fc |= PAUSE_TX;15151515- if (word & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_100M))15201520+ if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_100M))15161521 speed = 100;15171517- else if (word & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_1G))15221522+ else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_1G))15181523 speed = 1000;15191519- else if (word & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_10G))15241524+ else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_10G))15201525 speed = 10000;15211521- else if (word & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_40G))15261526+ else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_40G))15221527 speed = 40000;1523152815241529 /*···15351540 continue;1536154115371542 lc = &pi->link_cfg;15431543+15441544+ mod = FW_PORT_CMD_MODTYPE_G(stat);15451545+ if (mod != pi->mod_type) {15461546+ pi->mod_type = mod;15471547+ t4vf_os_portmod_changed(adapter, pidx);15481548+ }15491549+15381550 if (link_ok != lc->link_ok || speed != lc->speed ||15391551 fc != lc->fc) {15401552 /* something changed */15411553 lc->link_ok = link_ok;15421554 lc->speed = speed;15431555 lc->fc = fc;15561556+ lc->supported =15571557+ be16_to_cpu(port_cmd->u.info.pcap);15441558 t4vf_os_link_changed(adapter, pidx, link_ok);15451559 }15461560 }
+8-4
drivers/net/ethernet/cisco/enic/enic_main.c
···10601060 PKT_HASH_TYPE_L4 : PKT_HASH_TYPE_L3);10611061 }1062106210631063- if ((netdev->features & NETIF_F_RXCSUM) && !csum_not_calc) {10641064- skb->csum = htons(checksum);10651065- skb->ip_summed = CHECKSUM_COMPLETE;10661066- }10631063+ /* Hardware does not provide whole packet checksum. It only10641064+ * provides pseudo checksum. Since hw validates the packet10651065+ * checksum but not provide us the checksum value. use10661066+ * CHECSUM_UNNECESSARY.10671067+ */10681068+ if ((netdev->features & NETIF_F_RXCSUM) && tcp_udp_csum_ok &&10691069+ ipv4_csum_ok)10701070+ skb->ip_summed = CHECKSUM_UNNECESSARY;1067107110681072 if (vlan_stripped)10691073 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tci);
···962962 tx_desc->ctrl.owner_opcode = op_own;963963 if (send_doorbell) {964964 wmb();965965- iowrite32(ring->doorbell_qpn,965965+ /* Since there is no iowrite*_native() that writes the966966+ * value as is, without byteswapping - using the one967967+ * the doesn't do byteswapping in the relevant arch968968+ * endianness.969969+ */970970+#if defined(__LITTLE_ENDIAN)971971+ iowrite32(972972+#else973973+ iowrite32be(974974+#endif975975+ ring->doorbell_qpn,966976 ring->bf.uar->map + MLX4_SEND_DOORBELL);967977 } else {968978 ring->xmit_more++;
-6
drivers/net/ethernet/micrel/ksz884x.c
···2303230323042304/* Spanning Tree */2305230523062306-static inline void port_cfg_dis_learn(struct ksz_hw *hw, int p, int set)23072307-{23082308- port_cfg(hw, p,23092309- KS8842_PORT_CTRL_2_OFFSET, PORT_LEARN_DISABLE, set);23102310-}23112311-23122306static inline void port_cfg_rx(struct ksz_hw *hw, int p, int set)23132307{23142308 port_cfg(hw, p,
···16711671 * 0 on success and an appropriate (-)ve integer as defined in errno.h16721672 * file on failure.16731673 */16741674-static int stmmac_hw_setup(struct net_device *dev)16741674+static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)16751675{16761676 struct stmmac_priv *priv = netdev_priv(dev);16771677 int ret;···1708170817091709 stmmac_mmc_setup(priv);1710171017111711- ret = stmmac_init_ptp(priv);17121712- if (ret && ret != -EOPNOTSUPP)17131713- pr_warn("%s: failed PTP initialisation\n", __func__);17111711+ if (init_ptp) {17121712+ ret = stmmac_init_ptp(priv);17131713+ if (ret && ret != -EOPNOTSUPP)17141714+ pr_warn("%s: failed PTP initialisation\n", __func__);17151715+ }1714171617151717#ifdef CONFIG_DEBUG_FS17161718 ret = stmmac_init_fs(dev);···17891787 goto init_error;17901788 }1791178917921792- ret = stmmac_hw_setup(dev);17901790+ ret = stmmac_hw_setup(dev, true);17931791 if (ret < 0) {17941792 pr_err("%s: Hw setup failed\n", __func__);17951793 goto init_error;···30383036 netif_device_attach(ndev);3039303730403038 init_dma_desc_rings(ndev, GFP_ATOMIC);30413041- stmmac_hw_setup(ndev);30393039+ stmmac_hw_setup(ndev, false);30423040 stmmac_init_tx_coalesce(priv);3043304130443042 napi_enable(&priv->napi);
···388388 * @dma_err_tasklet: Tasklet structure to process Axi DMA errors389389 * @tx_irq: Axidma TX IRQ number390390 * @rx_irq: Axidma RX IRQ number391391- * @temac_type: axienet type to identify between soft and hard temac392391 * @phy_type: Phy type to identify between MII/GMII/RGMII/SGMII/1000 Base-X393392 * @options: AxiEthernet option word394393 * @last_link: Phy link state in which the PHY was negotiated earlier···430431431432 int tx_irq;432433 int rx_irq;433433- u32 temac_type;434434 u32 phy_type;435435436436 u32 options; /* Current options word */
-4
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
···15551555 if ((be32_to_cpup(p)) >= 0x4000)15561556 lp->jumbo_support = 1;15571557 }15581558- p = (__be32 *) of_get_property(op->dev.of_node, "xlnx,temac-type",15591559- NULL);15601560- if (p)15611561- lp->temac_type = be32_to_cpup(p);15621558 p = (__be32 *) of_get_property(op->dev.of_node, "xlnx,phy-type", NULL);15631559 if (p)15641560 lp->phy_type = be32_to_cpup(p);
···10041004{10051005 lockdep_assert_held(&mvm->mutex);1006100610071007- /* disallow low power states when the FW is down */10081008- iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN);10071007+ /*10081008+ * Disallow low power states when the FW is down by taking10091009+ * the UCODE_DOWN ref. in case of ongoing hw restart the10101010+ * ref is already taken, so don't take it again.10111011+ */10121012+ if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))10131013+ iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN);1009101410101015 /* async_handlers_wk is now blocked */10111016···1027102210281023 /* the fw is stopped, the aux sta is dead: clean up driver state */10291024 iwl_mvm_del_aux_sta(mvm);10251025+10261026+ /*10271027+ * Clear IN_HW_RESTART flag when stopping the hw (as restart_complete()10281028+ * won't be called in this case).10291029+ */10301030+ clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status);1030103110311032 mvm->ucode_loaded = false;10321033}
···614614{615615 u8 *v_addr;616616 dma_addr_t p_addr;617617- u32 offset, chunk_sz = section->len;617617+ u32 offset, chunk_sz = min_t(u32, FH_MEM_TB_MAX_LENGTH, section->len);618618 int ret = 0;619619620620 IWL_DEBUG_FW(trans, "[%d] uCode section being loaded...\n",···10121012 /* Stop the device, and put it in low power state */10131013 iwl_pcie_apm_stop(trans);1014101410151015- /* Upon stop, the APM issues an interrupt if HW RF kill is set.10161016- * Clean again the interrupt here10151015+ /* stop and reset the on-board processor */10161016+ iwl_write32(trans, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);10171017+ udelay(20);10181018+10191019+ /*10201020+ * Upon stop, the APM issues an interrupt if HW RF kill is set.10211021+ * This is a bug in certain verions of the hardware.10221022+ * Certain devices also keep sending HW RF kill interrupt all10231023+ * the time, unless the interrupt is ACKed even if the interrupt10241024+ * should be masked. Re-ACK all the interrupts here.10171025 */10181026 spin_lock(&trans_pcie->irq_lock);10191027 iwl_disable_interrupts(trans);10201028 spin_unlock(&trans_pcie->irq_lock);1021102910221022- /* stop and reset the on-board processor */10231023- iwl_write32(trans, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);10241024- udelay(20);1025103010261031 /* clear all status bits */10271032 clear_bit(STATUS_SYNC_HCMD_ACTIVE, &trans->status);
···18921892 goto fnic_abort_cmd_end;18931893 }1894189418951895+ /* IO out of order */18961896+18971897+ if (!(CMD_FLAGS(sc) & (FNIC_IO_ABORTED | FNIC_IO_DONE))) {18981898+ spin_unlock_irqrestore(io_lock, flags);18991899+ FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,19001900+ "Issuing Host reset due to out of order IO\n");19011901+19021902+ if (fnic_host_reset(sc) == FAILED) {19031903+ FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,19041904+ "fnic_host_reset failed.\n");19051905+ }19061906+ ret = FAILED;19071907+ goto fnic_abort_cmd_end;19081908+ }19091909+18951910 CMD_STATE(sc) = FNIC_IOREQ_ABTS_COMPLETE;1896191118971912 /*
···26232623 sd_config_discard(sdkp, SD_LBP_WS16);2624262426252625 } else { /* LBP VPD page tells us what to use */26262626-26272627- if (sdkp->lbpws)26262626+ if (sdkp->lbpu && sdkp->max_unmap_blocks && !sdkp->lbprz)26272627+ sd_config_discard(sdkp, SD_LBP_UNMAP);26282628+ else if (sdkp->lbpws)26282629 sd_config_discard(sdkp, SD_LBP_WS16);26292630 else if (sdkp->lbpws10)26302631 sd_config_discard(sdkp, SD_LBP_WS10);
···44 * Copyright (C) 2012 Samsung Electronics Co., Ltd(http://www.samsung.com)55 * Copyright (C) 2012 Amit Daniel <amit.kachhap@linaro.org>66 *77+ * Copyright (C) 2014 Viresh Kumar <viresh.kumar@linaro.org>88+ *79 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~810 * This program is free software; you can redistribute it and/or modify911 * it under the terms of the GNU General Public License as published by···3028#include <linux/cpu.h>3129#include <linux/cpu_cooling.h>32303131+/*3232+ * Cooling state <-> CPUFreq frequency3333+ *3434+ * Cooling states are translated to frequencies throughout this driver and this3535+ * is the relation between them.3636+ *3737+ * Highest cooling state corresponds to lowest possible frequency.3838+ *3939+ * i.e.4040+ * level 0 --> 1st Max Freq4141+ * level 1 --> 2nd Max Freq4242+ * ...4343+ */4444+3345/**3446 * struct cpufreq_cooling_device - data for cooling device with cpufreq3547 * @id: unique integer value corresponding to each cpufreq_cooling_device···5438 * cooling devices.5539 * @cpufreq_val: integer value representing the absolute value of the clipped5640 * frequency.4141+ * @max_level: maximum cooling level. One less than total number of valid4242+ * cpufreq frequencies.5743 * @allowed_cpus: all the cpus involved for this cpufreq_cooling_device.4444+ * @node: list_head to link all cpufreq_cooling_device together.5845 *5959- * This structure is required for keeping information of each6060- * cpufreq_cooling_device registered. In order to prevent corruption of this a6161- * mutex lock cooling_cpufreq_lock is used.4646+ * This structure is required for keeping information of each registered4747+ * cpufreq_cooling_device.6248 */6349struct cpufreq_cooling_device {6450 int id;6551 struct thermal_cooling_device *cool_dev;6652 unsigned int cpufreq_state;6753 unsigned int cpufreq_val;5454+ unsigned int max_level;5555+ unsigned int *freq_table; /* In descending order */6856 struct cpumask allowed_cpus;6957 struct list_head node;7058};7159static DEFINE_IDR(cpufreq_idr);7260static DEFINE_MUTEX(cooling_cpufreq_lock);7373-7474-static unsigned int cpufreq_dev_count;75617662static LIST_HEAD(cpufreq_dev_list);7763···11698/* Below code defines functions to be used for cpufreq as cooling device */11799118100/**119119- * is_cpufreq_valid - function to check frequency transitioning capability.120120- * @cpu: cpu for which check is needed.101101+ * get_level: Find the level for a particular frequency102102+ * @cpufreq_dev: cpufreq_dev for which the property is required103103+ * @freq: Frequency121104 *122122- * This function will check the current state of the system if123123- * it is capable of changing the frequency for a given @cpu.124124- *125125- * Return: 0 if the system is not currently capable of changing126126- * the frequency of given cpu. !0 in case the frequency is changeable.105105+ * Return: level on success, THERMAL_CSTATE_INVALID on error.127106 */128128-static int is_cpufreq_valid(int cpu)107107+static unsigned long get_level(struct cpufreq_cooling_device *cpufreq_dev,108108+ unsigned int freq)129109{130130- struct cpufreq_policy policy;110110+ unsigned long level;131111132132- return !cpufreq_get_policy(&policy, cpu);133133-}112112+ for (level = 0; level <= cpufreq_dev->max_level; level++) {113113+ if (freq == cpufreq_dev->freq_table[level])114114+ return level;134115135135-enum cpufreq_cooling_property {136136- GET_LEVEL,137137- GET_FREQ,138138- GET_MAXL,139139-};140140-141141-/**142142- * get_property - fetch a property of interest for a give cpu.143143- * @cpu: cpu for which the property is required144144- * @input: query parameter145145- * @output: query return146146- * @property: type of query (frequency, level, max level)147147- *148148- * This is the common function to149149- * 1. get maximum cpu cooling states150150- * 2. translate frequency to cooling state151151- * 3. translate cooling state to frequency152152- * Note that the code may be not in good shape153153- * but it is written in this way in order to:154154- * a) reduce duplicate code as most of the code can be shared.155155- * b) make sure the logic is consistent when translating between156156- * cooling states and frequencies.157157- *158158- * Return: 0 on success, -EINVAL when invalid parameters are passed.159159- */160160-static int get_property(unsigned int cpu, unsigned long input,161161- unsigned int *output,162162- enum cpufreq_cooling_property property)163163-{164164- int i;165165- unsigned long max_level = 0, level = 0;166166- unsigned int freq = CPUFREQ_ENTRY_INVALID;167167- int descend = -1;168168- struct cpufreq_frequency_table *pos, *table =169169- cpufreq_frequency_get_table(cpu);170170-171171- if (!output)172172- return -EINVAL;173173-174174- if (!table)175175- return -EINVAL;176176-177177- cpufreq_for_each_valid_entry(pos, table) {178178- /* ignore duplicate entry */179179- if (freq == pos->frequency)180180- continue;181181-182182- /* get the frequency order */183183- if (freq != CPUFREQ_ENTRY_INVALID && descend == -1)184184- descend = freq > pos->frequency;185185-186186- freq = pos->frequency;187187- max_level++;116116+ if (freq > cpufreq_dev->freq_table[level])117117+ break;188118 }189119190190- /* No valid cpu frequency entry */191191- if (max_level == 0)192192- return -EINVAL;193193-194194- /* max_level is an index, not a counter */195195- max_level--;196196-197197- /* get max level */198198- if (property == GET_MAXL) {199199- *output = (unsigned int)max_level;200200- return 0;201201- }202202-203203- if (property == GET_FREQ)204204- level = descend ? input : (max_level - input);205205-206206- i = 0;207207- cpufreq_for_each_valid_entry(pos, table) {208208- /* ignore duplicate entry */209209- if (freq == pos->frequency)210210- continue;211211-212212- /* now we have a valid frequency entry */213213- freq = pos->frequency;214214-215215- if (property == GET_LEVEL && (unsigned int)input == freq) {216216- /* get level by frequency */217217- *output = descend ? i : (max_level - i);218218- return 0;219219- }220220- if (property == GET_FREQ && level == i) {221221- /* get frequency by level */222222- *output = freq;223223- return 0;224224- }225225- i++;226226- }227227-228228- return -EINVAL;120120+ return THERMAL_CSTATE_INVALID;229121}230122231123/**232232- * cpufreq_cooling_get_level - for a give cpu, return the cooling level.124124+ * cpufreq_cooling_get_level - for a given cpu, return the cooling level.233125 * @cpu: cpu for which the level is required234126 * @freq: the frequency of interest235127 *···151223 */152224unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq)153225{154154- unsigned int val;226226+ struct cpufreq_cooling_device *cpufreq_dev;155227156156- if (get_property(cpu, (unsigned long)freq, &val, GET_LEVEL))157157- return THERMAL_CSTATE_INVALID;228228+ mutex_lock(&cooling_cpufreq_lock);229229+ list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) {230230+ if (cpumask_test_cpu(cpu, &cpufreq_dev->allowed_cpus)) {231231+ mutex_unlock(&cooling_cpufreq_lock);232232+ return get_level(cpufreq_dev, freq);233233+ }234234+ }235235+ mutex_unlock(&cooling_cpufreq_lock);158236159159- return (unsigned long)val;237237+ pr_err("%s: cpu:%d not part of any cooling device\n", __func__, cpu);238238+ return THERMAL_CSTATE_INVALID;160239}161240EXPORT_SYMBOL_GPL(cpufreq_cooling_get_level);162162-163163-/**164164- * get_cpu_frequency - get the absolute value of frequency from level.165165- * @cpu: cpu for which frequency is fetched.166166- * @level: cooling level167167- *168168- * This function matches cooling level with frequency. Based on a cooling level169169- * of frequency, equals cooling state of cpu cooling device, it will return170170- * the corresponding frequency.171171- * e.g level=0 --> 1st MAX FREQ, level=1 ---> 2nd MAX FREQ, .... etc172172- *173173- * Return: 0 on error, the corresponding frequency otherwise.174174- */175175-static unsigned int get_cpu_frequency(unsigned int cpu, unsigned long level)176176-{177177- int ret = 0;178178- unsigned int freq;179179-180180- ret = get_property(cpu, level, &freq, GET_FREQ);181181- if (ret)182182- return 0;183183-184184- return freq;185185-}186186-187187-/**188188- * cpufreq_apply_cooling - function to apply frequency clipping.189189- * @cpufreq_device: cpufreq_cooling_device pointer containing frequency190190- * clipping data.191191- * @cooling_state: value of the cooling state.192192- *193193- * Function used to make sure the cpufreq layer is aware of current thermal194194- * limits. The limits are applied by updating the cpufreq policy.195195- *196196- * Return: 0 on success, an error code otherwise (-EINVAL in case wrong197197- * cooling state).198198- */199199-static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device,200200- unsigned long cooling_state)201201-{202202- unsigned int cpuid, clip_freq;203203- struct cpumask *mask = &cpufreq_device->allowed_cpus;204204- unsigned int cpu = cpumask_any(mask);205205-206206-207207- /* Check if the old cooling action is same as new cooling action */208208- if (cpufreq_device->cpufreq_state == cooling_state)209209- return 0;210210-211211- clip_freq = get_cpu_frequency(cpu, cooling_state);212212- if (!clip_freq)213213- return -EINVAL;214214-215215- cpufreq_device->cpufreq_state = cooling_state;216216- cpufreq_device->cpufreq_val = clip_freq;217217-218218- for_each_cpu(cpuid, mask) {219219- if (is_cpufreq_valid(cpuid))220220- cpufreq_update_policy(cpuid);221221- }222222-223223- return 0;224224-}225241226242/**227243 * cpufreq_thermal_notifier - notifier callback for cpufreq policy change.···195323 &cpufreq_dev->allowed_cpus))196324 continue;197325198198- if (!cpufreq_dev->cpufreq_val)199199- cpufreq_dev->cpufreq_val = get_cpu_frequency(200200- cpumask_any(&cpufreq_dev->allowed_cpus),201201- cpufreq_dev->cpufreq_state);202202-203326 max_freq = cpufreq_dev->cpufreq_val;204327205328 if (policy->max != max_freq)···221354 unsigned long *state)222355{223356 struct cpufreq_cooling_device *cpufreq_device = cdev->devdata;224224- struct cpumask *mask = &cpufreq_device->allowed_cpus;225225- unsigned int cpu;226226- unsigned int count = 0;227227- int ret;228357229229- cpu = cpumask_any(mask);230230-231231- ret = get_property(cpu, 0, &count, GET_MAXL);232232-233233- if (count > 0)234234- *state = count;235235-236236- return ret;358358+ *state = cpufreq_device->max_level;359359+ return 0;237360}238361239362/**···260403 unsigned long state)261404{262405 struct cpufreq_cooling_device *cpufreq_device = cdev->devdata;406406+ unsigned int cpu = cpumask_any(&cpufreq_device->allowed_cpus);407407+ unsigned int clip_freq;263408264264- return cpufreq_apply_cooling(cpufreq_device, state);409409+ /* Request state should be less than max_level */410410+ if (WARN_ON(state > cpufreq_device->max_level))411411+ return -EINVAL;412412+413413+ /* Check if the old cooling action is same as new cooling action */414414+ if (cpufreq_device->cpufreq_state == state)415415+ return 0;416416+417417+ clip_freq = cpufreq_device->freq_table[state];418418+ cpufreq_device->cpufreq_state = state;419419+ cpufreq_device->cpufreq_val = clip_freq;420420+421421+ cpufreq_update_policy(cpu);422422+423423+ return 0;265424}266425267426/* Bind cpufreq callbacks to thermal cooling device ops */···292419 .notifier_call = cpufreq_thermal_notifier,293420};294421422422+static unsigned int find_next_max(struct cpufreq_frequency_table *table,423423+ unsigned int prev_max)424424+{425425+ struct cpufreq_frequency_table *pos;426426+ unsigned int max = 0;427427+428428+ cpufreq_for_each_valid_entry(pos, table) {429429+ if (pos->frequency > max && pos->frequency < prev_max)430430+ max = pos->frequency;431431+ }432432+433433+ return max;434434+}435435+295436/**296437 * __cpufreq_cooling_register - helper function to create cpufreq cooling device297438 * @np: a valid struct device_node to the cooling device device tree node298439 * @clip_cpus: cpumask of cpus where the frequency constraints will happen.440440+ * Normally this should be same as cpufreq policy->related_cpus.299441 *300442 * This interface function registers the cpufreq cooling device with the name301443 * "thermal-cpufreq-%x". This api can support multiple instances of cpufreq···325437 const struct cpumask *clip_cpus)326438{327439 struct thermal_cooling_device *cool_dev;328328- struct cpufreq_cooling_device *cpufreq_dev = NULL;329329- unsigned int min = 0, max = 0;440440+ struct cpufreq_cooling_device *cpufreq_dev;330441 char dev_name[THERMAL_NAME_LENGTH];331331- int ret = 0, i;332332- struct cpufreq_policy policy;442442+ struct cpufreq_frequency_table *pos, *table;443443+ unsigned int freq, i;444444+ int ret;333445334334- /* Verify that all the clip cpus have same freq_min, freq_max limit */335335- for_each_cpu(i, clip_cpus) {336336- /* continue if cpufreq policy not found and not return error */337337- if (!cpufreq_get_policy(&policy, i))338338- continue;339339- if (min == 0 && max == 0) {340340- min = policy.cpuinfo.min_freq;341341- max = policy.cpuinfo.max_freq;342342- } else {343343- if (min != policy.cpuinfo.min_freq ||344344- max != policy.cpuinfo.max_freq)345345- return ERR_PTR(-EINVAL);346346- }446446+ table = cpufreq_frequency_get_table(cpumask_first(clip_cpus));447447+ if (!table) {448448+ pr_debug("%s: CPUFreq table not found\n", __func__);449449+ return ERR_PTR(-EPROBE_DEFER);347450 }348348- cpufreq_dev = kzalloc(sizeof(struct cpufreq_cooling_device),349349- GFP_KERNEL);451451+452452+ cpufreq_dev = kzalloc(sizeof(*cpufreq_dev), GFP_KERNEL);350453 if (!cpufreq_dev)351454 return ERR_PTR(-ENOMEM);455455+456456+ /* Find max levels */457457+ cpufreq_for_each_valid_entry(pos, table)458458+ cpufreq_dev->max_level++;459459+460460+ cpufreq_dev->freq_table = kmalloc(sizeof(*cpufreq_dev->freq_table) *461461+ cpufreq_dev->max_level, GFP_KERNEL);462462+ if (!cpufreq_dev->freq_table) {463463+ cool_dev = ERR_PTR(-ENOMEM);464464+ goto free_cdev;465465+ }466466+467467+ /* max_level is an index, not a counter */468468+ cpufreq_dev->max_level--;352469353470 cpumask_copy(&cpufreq_dev->allowed_cpus, clip_cpus);354471355472 ret = get_idr(&cpufreq_idr, &cpufreq_dev->id);356473 if (ret) {357357- kfree(cpufreq_dev);358358- return ERR_PTR(-EINVAL);474474+ cool_dev = ERR_PTR(ret);475475+ goto free_table;359476 }360477361478 snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",···368475369476 cool_dev = thermal_of_cooling_device_register(np, dev_name, cpufreq_dev,370477 &cpufreq_cooling_ops);371371- if (IS_ERR(cool_dev)) {372372- release_idr(&cpufreq_idr, cpufreq_dev->id);373373- kfree(cpufreq_dev);374374- return cool_dev;478478+ if (IS_ERR(cool_dev))479479+ goto remove_idr;480480+481481+ /* Fill freq-table in descending order of frequencies */482482+ for (i = 0, freq = -1; i <= cpufreq_dev->max_level; i++) {483483+ freq = find_next_max(table, freq);484484+ cpufreq_dev->freq_table[i] = freq;485485+486486+ /* Warn for duplicate entries */487487+ if (!freq)488488+ pr_warn("%s: table has duplicate entries\n", __func__);489489+ else490490+ pr_debug("%s: freq:%u KHz\n", __func__, freq);375491 }492492+493493+ cpufreq_dev->cpufreq_val = cpufreq_dev->freq_table[0];376494 cpufreq_dev->cool_dev = cool_dev;377377- cpufreq_dev->cpufreq_state = 0;495495+378496 mutex_lock(&cooling_cpufreq_lock);379497380498 /* Register the notifier for first cpufreq cooling device */381381- if (cpufreq_dev_count == 0)499499+ if (list_empty(&cpufreq_dev_list))382500 cpufreq_register_notifier(&thermal_cpufreq_notifier_block,383501 CPUFREQ_POLICY_NOTIFIER);384384- cpufreq_dev_count++;385502 list_add(&cpufreq_dev->node, &cpufreq_dev_list);386503387504 mutex_unlock(&cooling_cpufreq_lock);505505+506506+ return cool_dev;507507+508508+remove_idr:509509+ release_idr(&cpufreq_idr, cpufreq_dev->id);510510+free_table:511511+ kfree(cpufreq_dev->freq_table);512512+free_cdev:513513+ kfree(cpufreq_dev);388514389515 return cool_dev;390516}···466554 cpufreq_dev = cdev->devdata;467555 mutex_lock(&cooling_cpufreq_lock);468556 list_del(&cpufreq_dev->node);469469- cpufreq_dev_count--;470557471558 /* Unregister the notifier for the last cpufreq cooling device */472472- if (cpufreq_dev_count == 0)559559+ if (list_empty(&cpufreq_dev_list))473560 cpufreq_unregister_notifier(&thermal_cpufreq_notifier_block,474561 CPUFREQ_POLICY_NOTIFIER);475562 mutex_unlock(&cooling_cpufreq_lock);476563477564 thermal_cooling_device_unregister(cpufreq_dev->cool_dev);478565 release_idr(&cpufreq_idr, cpufreq_dev->id);566566+ kfree(cpufreq_dev->freq_table);479567 kfree(cpufreq_dev);480568}481569EXPORT_SYMBOL_GPL(cpufreq_cooling_unregister);
+9-11
drivers/thermal/db8500_cpufreq_cooling.c
···1818 */19192020#include <linux/cpu_cooling.h>2121-#include <linux/cpufreq.h>2221#include <linux/err.h>2322#include <linux/module.h>2423#include <linux/of.h>···2728static int db8500_cpufreq_cooling_probe(struct platform_device *pdev)2829{2930 struct thermal_cooling_device *cdev;3030- struct cpumask mask_val;31313232- /* make sure cpufreq driver has been initialized */3333- if (!cpufreq_frequency_get_table(0))3434- return -EPROBE_DEFER;3535-3636- cpumask_set_cpu(0, &mask_val);3737- cdev = cpufreq_cooling_register(&mask_val);3838-3232+ cdev = cpufreq_cooling_register(cpu_present_mask);3933 if (IS_ERR(cdev)) {4040- dev_err(&pdev->dev, "Failed to register cooling device\n");4141- return PTR_ERR(cdev);3434+ int ret = PTR_ERR(cdev);3535+3636+ if (ret != -EPROBE_DEFER)3737+ dev_err(&pdev->dev,3838+ "Failed to register cooling device %d\n",3939+ ret);4040+4141+ return ret;4242 }43434444 platform_set_drvdata(pdev, cdev);
+5-10
drivers/thermal/imx_thermal.c
···991010#include <linux/clk.h>1111#include <linux/cpu_cooling.h>1212-#include <linux/cpufreq.h>1312#include <linux/delay.h>1413#include <linux/device.h>1514#include <linux/init.h>···453454 const struct of_device_id *of_id =454455 of_match_device(of_imx_thermal_match, &pdev->dev);455456 struct imx_thermal_data *data;456456- struct cpumask clip_cpus;457457 struct regmap *map;458458 int measure_freq;459459 int ret;460460461461- if (!cpufreq_get_current_driver()) {462462- dev_dbg(&pdev->dev, "no cpufreq driver!");463463- return -EPROBE_DEFER;464464- }465461 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);466462 if (!data)467463 return -ENOMEM;···510516 regmap_write(map, MISC0 + REG_SET, MISC0_REFTOP_SELBIASOFF);511517 regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_POWER_DOWN);512518513513- cpumask_set_cpu(0, &clip_cpus);514514- data->cdev = cpufreq_cooling_register(&clip_cpus);519519+ data->cdev = cpufreq_cooling_register(cpu_present_mask);515520 if (IS_ERR(data->cdev)) {516521 ret = PTR_ERR(data->cdev);517517- dev_err(&pdev->dev,518518- "failed to register cpufreq cooling device: %d\n", ret);522522+ if (ret != -EPROBE_DEFER)523523+ dev_err(&pdev->dev,524524+ "failed to register cpufreq cooling device: %d\n",525525+ ret);519526 return ret;520527 }521528
···11config EXYNOS_THERMAL22 tristate "Exynos thermal management unit driver"33- depends on ARCH_HAS_BANDGAP && OF33+ depends on OF44 help55 If you say yes here you get support for the TMU (Thermal Management66 Unit) driver for SAMSUNG EXYNOS series of SoCs. This driver initialises
+6-6
drivers/thermal/samsung/exynos_thermal_common.c
···347347int exynos_register_thermal(struct thermal_sensor_conf *sensor_conf)348348{349349 int ret;350350- struct cpumask mask_val;351350 struct exynos_thermal_zone *th_zone;352351353352 if (!sensor_conf || !sensor_conf->read_temperature) {···366367 * sensor367368 */368369 if (sensor_conf->cooling_data.freq_clip_count > 0) {369369- cpumask_set_cpu(0, &mask_val);370370 th_zone->cool_dev[th_zone->cool_dev_size] =371371- cpufreq_cooling_register(&mask_val);371371+ cpufreq_cooling_register(cpu_present_mask);372372 if (IS_ERR(th_zone->cool_dev[th_zone->cool_dev_size])) {373373- dev_err(sensor_conf->dev,374374- "Failed to register cpufreq cooling device\n");375375- ret = -EINVAL;373373+ ret = PTR_ERR(th_zone->cool_dev[th_zone->cool_dev_size]);374374+ if (ret != -EPROBE_DEFER)375375+ dev_err(sensor_conf->dev,376376+ "Failed to register cpufreq cooling device: %d\n",377377+ ret);376378 goto err_unregister;377379 }378380 th_zone->cool_dev_size++;
+4-1
drivers/thermal/samsung/exynos_tmu.c
···927927 /* Register the sensor with thermal management interface */928928 ret = exynos_register_thermal(sensor_conf);929929 if (ret) {930930- dev_err(&pdev->dev, "Failed to register thermal interface\n");930930+ if (ret != -EPROBE_DEFER)931931+ dev_err(&pdev->dev,932932+ "Failed to register thermal interface: %d\n",933933+ ret);931934 goto err_clk;932935 }933936 data->reg_conf = sensor_conf;
+4-2
drivers/thermal/thermal_core.c
···930930 struct thermal_zone_device *pos1;931931 struct thermal_cooling_device *pos2;932932 unsigned long max_state;933933- int result;933933+ int result, ret;934934935935 if (trip >= tz->trips || (trip < 0 && trip != THERMAL_TRIPS_NONE))936936 return -EINVAL;···947947 if (tz != pos1 || cdev != pos2)948948 return -EINVAL;949949950950- cdev->ops->get_max_state(cdev, &max_state);950950+ ret = cdev->ops->get_max_state(cdev, &max_state);951951+ if (ret)952952+ return ret;951953952954 /* lower default 0, upper default max_state */953955 lower = lower == THERMAL_NO_LIMIT ? 0 : lower;
···9797 return 0;98989999err_enable:100100- regulator_disable(pll->regulator);100100+ if (pll->regulator)101101+ regulator_disable(pll->regulator);101102err_reg:102103 clk_disable_unprepare(pll->clkin);103104 return r;
+2
drivers/video/fbdev/omap2/dss/sdi.c
···342342 out->output_type = OMAP_DISPLAY_TYPE_SDI;343343 out->name = "sdi.0";344344 out->dispc_channel = OMAP_DSS_CHANNEL_LCD;345345+ /* We have SDI only on OMAP3, where it's on port 1 */346346+ out->port_num = 1;345347 out->ops.sdi = &sdi_ops;346348 out->owner = THIS_MODULE;347349
+16-1
drivers/video/logo/logo.c
···2121module_param(nologo, bool, 0);2222MODULE_PARM_DESC(nologo, "Disables startup logo");23232424+/*2525+ * Logos are located in the initdata, and will be freed in kernel_init.2626+ * Use late_init to mark the logos as freed to prevent any further use.2727+ */2828+2929+static bool logos_freed;3030+3131+static int __init fb_logo_late_init(void)3232+{3333+ logos_freed = true;3434+ return 0;3535+}3636+3737+late_initcall(fb_logo_late_init);3838+2439/* logo's are marked __initdata. Use __init_refok to tell2540 * modpost that it is intended that this function uses data2641 * marked __initdata.···4429{4530 const struct linux_logo *logo = NULL;46314747- if (nologo)3232+ if (nologo || logos_freed)4833 return NULL;49345035 if (depth >= 1) {
+3-3
fs/cifs/cifsglob.h
···661661 server->ops->set_credits(server, val);662662}663663664664-static inline __u64664664+static inline __le64665665get_next_mid64(struct TCP_Server_Info *server)666666{667667- return server->ops->get_next_mid(server);667667+ return cpu_to_le64(server->ops->get_next_mid(server));668668}669669670670static inline __le16671671get_next_mid(struct TCP_Server_Info *server)672672{673673- __u16 mid = get_next_mid64(server);673673+ __u16 mid = server->ops->get_next_mid(server);674674 /*675675 * The value in the SMB header should be little endian for easy676676 * on-the-wire decoding.
+7-5
fs/cifs/netmisc.c
···926926927927 /* Subtract the NTFS time offset, then convert to 1s intervals. */928928 s64 t = le64_to_cpu(ntutc) - NTFS_TIME_OFFSET;929929+ u64 abs_t;929930930931 /*931932 * Unfortunately can not use normal 64 bit division on 32 bit arch, but···934933 * to special case them935934 */936935 if (t < 0) {937937- t = -t;938938- ts.tv_nsec = (long)(do_div(t, 10000000) * 100);936936+ abs_t = -t;937937+ ts.tv_nsec = (long)(do_div(abs_t, 10000000) * 100);939938 ts.tv_nsec = -ts.tv_nsec;940940- ts.tv_sec = -t;939939+ ts.tv_sec = -abs_t;941940 } else {942942- ts.tv_nsec = (long)do_div(t, 10000000) * 100;943943- ts.tv_sec = t;941941+ abs_t = t;942942+ ts.tv_nsec = (long)do_div(abs_t, 10000000) * 100;943943+ ts.tv_sec = abs_t;944944 }945945946946 return ts;
+7-3
fs/cifs/readdir.c
···6969 * Attempt to preload the dcache with the results from the FIND_FIRST/NEXT7070 *7171 * Find the dentry that matches "name". If there isn't one, create one. If it's7272- * a negative dentry or the uniqueid changed, then drop it and recreate it.7272+ * a negative dentry or the uniqueid or filetype(mode) changed,7373+ * then drop it and recreate it.7374 */7475static void7576cifs_prime_dcache(struct dentry *parent, struct qstr *name,···9897 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM))9998 fattr->cf_uniqueid = CIFS_I(inode)->uniqueid;10099101101- /* update inode in place if i_ino didn't change */102102- if (CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) {100100+ /* update inode in place101101+ * if both i_ino and i_mode didn't change */102102+ if (CIFS_I(inode)->uniqueid == fattr->cf_uniqueid &&103103+ (inode->i_mode & S_IFMT) ==104104+ (fattr->cf_mode & S_IFMT)) {103105 cifs_fattr_to_inode(inode, fattr);104106 goto out;105107 }
+7-5
fs/cifs/smb2misc.c
···3232static int3333check_smb2_hdr(struct smb2_hdr *hdr, __u64 mid)3434{3535+ __u64 wire_mid = le64_to_cpu(hdr->MessageId);3636+3537 /*3638 * Make sure that this really is an SMB, that it is a response,3739 * and that the message ids match.3840 */3941 if ((*(__le32 *)hdr->ProtocolId == SMB2_PROTO_NUMBER) &&4040- (mid == hdr->MessageId)) {4242+ (mid == wire_mid)) {4143 if (hdr->Flags & SMB2_FLAGS_SERVER_TO_REDIR)4244 return 0;4345 else {···5351 if (*(__le32 *)hdr->ProtocolId != SMB2_PROTO_NUMBER)5452 cifs_dbg(VFS, "Bad protocol string signature header %x\n",5553 *(unsigned int *) hdr->ProtocolId);5656- if (mid != hdr->MessageId)5454+ if (mid != wire_mid)5755 cifs_dbg(VFS, "Mids do not match: %llu and %llu\n",5858- mid, hdr->MessageId);5656+ mid, wire_mid);5957 }6060- cifs_dbg(VFS, "Bad SMB detected. The Mid=%llu\n", hdr->MessageId);5858+ cifs_dbg(VFS, "Bad SMB detected. The Mid=%llu\n", wire_mid);6159 return 1;6260}6361···9795{9896 struct smb2_hdr *hdr = (struct smb2_hdr *)buf;9997 struct smb2_pdu *pdu = (struct smb2_pdu *)hdr;100100- __u64 mid = hdr->MessageId;9898+ __u64 mid = le64_to_cpu(hdr->MessageId);10199 __u32 len = get_rfc1002_length(buf);102100 __u32 clc_len; /* calculated length */103101 int command;
···110110 __le16 CreditRequest; /* CreditResponse */111111 __le32 Flags;112112 __le32 NextCommand;113113- __u64 MessageId; /* opaque - so can stay little endian */113113+ __le64 MessageId;114114 __le32 ProcessId;115115 __u32 TreeId; /* opaque - so do not make little endian */116116 __u64 SessionId; /* opaque - so do not make little endian */
···362362 rs.cont_size = isonum_733(rr->u.CE.size);363363 break;364364 case SIG('E', 'R'):365365+ /* Invalid length of ER tag id? */366366+ if (rr->u.ER.len_id + offsetof(struct rock_ridge, u.ER.data) > rr->len)367367+ goto out;365368 ISOFS_SB(inode->i_sb)->s_rock = 1;366369 printk(KERN_DEBUG "ISO 9660 Extensions: ");367370 {
+16-15
fs/udf/dir.c
···5757 sector_t offset;5858 int i, num, ret = 0;5959 struct extent_position epos = { NULL, 0, {0, 0} };6060+ struct super_block *sb = dir->i_sb;60616162 if (ctx->pos == 0) {6263 if (!dir_emit_dot(file, ctx))···7776 if (nf_pos == 0)7877 nf_pos = udf_ext0_offset(dir);79788080- fibh.soffset = fibh.eoffset = nf_pos & (dir->i_sb->s_blocksize - 1);7979+ fibh.soffset = fibh.eoffset = nf_pos & (sb->s_blocksize - 1);8180 if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {8282- if (inode_bmap(dir, nf_pos >> dir->i_sb->s_blocksize_bits,8181+ if (inode_bmap(dir, nf_pos >> sb->s_blocksize_bits,8382 &epos, &eloc, &elen, &offset)8483 != (EXT_RECORDED_ALLOCATED >> 30)) {8584 ret = -ENOENT;8685 goto out;8786 }8888- block = udf_get_lb_pblock(dir->i_sb, &eloc, offset);8989- if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {8787+ block = udf_get_lb_pblock(sb, &eloc, offset);8888+ if ((++offset << sb->s_blocksize_bits) < elen) {9089 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)9190 epos.offset -= sizeof(struct short_ad);9291 else if (iinfo->i_alloc_type ==···9695 offset = 0;9796 }98979999- if (!(fibh.sbh = fibh.ebh = udf_tread(dir->i_sb, block))) {9898+ if (!(fibh.sbh = fibh.ebh = udf_tread(sb, block))) {10099 ret = -EIO;101100 goto out;102101 }103102104104- if (!(offset & ((16 >> (dir->i_sb->s_blocksize_bits - 9)) - 1))) {105105- i = 16 >> (dir->i_sb->s_blocksize_bits - 9);106106- if (i + offset > (elen >> dir->i_sb->s_blocksize_bits))107107- i = (elen >> dir->i_sb->s_blocksize_bits) - offset;103103+ if (!(offset & ((16 >> (sb->s_blocksize_bits - 9)) - 1))) {104104+ i = 16 >> (sb->s_blocksize_bits - 9);105105+ if (i + offset > (elen >> sb->s_blocksize_bits))106106+ i = (elen >> sb->s_blocksize_bits) - offset;108107 for (num = 0; i > 0; i--) {109109- block = udf_get_lb_pblock(dir->i_sb, &eloc, offset + i);110110- tmp = udf_tgetblk(dir->i_sb, block);108108+ block = udf_get_lb_pblock(sb, &eloc, offset + i);109109+ tmp = udf_tgetblk(sb, block);111110 if (tmp && !buffer_uptodate(tmp) && !buffer_locked(tmp))112111 bha[num++] = tmp;113112 else···153152 }154153155154 if ((cfi.fileCharacteristics & FID_FILE_CHAR_DELETED) != 0) {156156- if (!UDF_QUERY_FLAG(dir->i_sb, UDF_FLAG_UNDELETE))155155+ if (!UDF_QUERY_FLAG(sb, UDF_FLAG_UNDELETE))157156 continue;158157 }159158160159 if ((cfi.fileCharacteristics & FID_FILE_CHAR_HIDDEN) != 0) {161161- if (!UDF_QUERY_FLAG(dir->i_sb, UDF_FLAG_UNHIDE))160160+ if (!UDF_QUERY_FLAG(sb, UDF_FLAG_UNHIDE))162161 continue;163162 }164163···168167 continue;169168 }170169171171- flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi);170170+ flen = udf_get_filename(sb, nameptr, lfi, fname, UDF_NAME_LEN);172171 if (!flen)173172 continue;174173175174 tloc = lelb_to_cpu(cfi.icb.extLocation);176176- iblock = udf_get_lb_pblock(dir->i_sb, &tloc, 0);175175+ iblock = udf_get_lb_pblock(sb, &tloc, 0);177176 if (!dir_emit(ctx, fname, flen, iblock, DT_UNKNOWN))178177 goto out;179178 } /* end while */
+14
fs/udf/inode.c
···14891489 }14901490 inode->i_generation = iinfo->i_unique;1491149114921492+ /* Sanity checks for files in ICB so that we don't get confused later */14931493+ if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {14941494+ /*14951495+ * For file in ICB data is stored in allocation descriptor14961496+ * so sizes should match14971497+ */14981498+ if (iinfo->i_lenAlloc != inode->i_size)14991499+ goto out;15001500+ /* File in ICB has to fit in there... */15011501+ if (inode->i_size > inode->i_sb->s_blocksize -15021502+ udf_file_entry_alloc_offset(inode))15031503+ goto out;15041504+ }15051505+14921506 switch (fe->icbTag.fileType) {14931507 case ICBTAG_FILE_TYPE_DIRECTORY:14941508 inode->i_op = &udf_dir_inode_operations;
···3030#include <linux/buffer_head.h>3131#include "udf_i.h"32323333-static void udf_pc_to_char(struct super_block *sb, unsigned char *from,3434- int fromlen, unsigned char *to)3333+static int udf_pc_to_char(struct super_block *sb, unsigned char *from,3434+ int fromlen, unsigned char *to, int tolen)3535{3636 struct pathComponent *pc;3737 int elen = 0;3838+ int comp_len;3839 unsigned char *p = to;39404141+ /* Reserve one byte for terminating \0 */4242+ tolen--;4043 while (elen < fromlen) {4144 pc = (struct pathComponent *)(from + elen);4545+ elen += sizeof(struct pathComponent);4246 switch (pc->componentType) {4347 case 1:4448 /*4549 * Symlink points to some place which should be agreed4650 * upon between originator and receiver of the media. Ignore.4751 */4848- if (pc->lengthComponentIdent > 0)5252+ if (pc->lengthComponentIdent > 0) {5353+ elen += pc->lengthComponentIdent;4954 break;5555+ }5056 /* Fall through */5157 case 2:5858+ if (tolen == 0)5959+ return -ENAMETOOLONG;5260 p = to;5361 *p++ = '/';6262+ tolen--;5463 break;5564 case 3:6565+ if (tolen < 3)6666+ return -ENAMETOOLONG;5667 memcpy(p, "../", 3);5768 p += 3;6969+ tolen -= 3;5870 break;5971 case 4:7272+ if (tolen < 2)7373+ return -ENAMETOOLONG;6074 memcpy(p, "./", 2);6175 p += 2;7676+ tolen -= 2;6277 /* that would be . - just ignore */6378 break;6479 case 5:6565- p += udf_get_filename(sb, pc->componentIdent, p,6666- pc->lengthComponentIdent);8080+ elen += pc->lengthComponentIdent;8181+ if (elen > fromlen)8282+ return -EIO;8383+ comp_len = udf_get_filename(sb, pc->componentIdent,8484+ pc->lengthComponentIdent,8585+ p, tolen);8686+ p += comp_len;8787+ tolen -= comp_len;8888+ if (tolen == 0)8989+ return -ENAMETOOLONG;6790 *p++ = '/';9191+ tolen--;6892 break;6993 }7070- elen += sizeof(struct pathComponent) + pc->lengthComponentIdent;7194 }7295 if (p > to + 1)7396 p[-1] = '\0';7497 else7598 p[0] = '\0';9999+ return 0;76100}7710178102static int udf_symlink_filler(struct file *file, struct page *page)···10480 struct inode *inode = page->mapping->host;10581 struct buffer_head *bh = NULL;10682 unsigned char *symlink;107107- int err = -EIO;8383+ int err;10884 unsigned char *p = kmap(page);10985 struct udf_inode_info *iinfo;11086 uint32_t pos;8787+8888+ /* We don't support symlinks longer than one block */8989+ if (inode->i_size > inode->i_sb->s_blocksize) {9090+ err = -ENAMETOOLONG;9191+ goto out_unmap;9292+ }1119311294 iinfo = UDF_I(inode);11395 pos = udf_block_map(inode, 0);···12494 } else {12595 bh = sb_bread(inode->i_sb, pos);12696127127- if (!bh)128128- goto out;9797+ if (!bh) {9898+ err = -EIO;9999+ goto out_unlock_inode;100100+ }129101130102 symlink = bh->b_data;131103 }132104133133- udf_pc_to_char(inode->i_sb, symlink, inode->i_size, p);105105+ err = udf_pc_to_char(inode->i_sb, symlink, inode->i_size, p, PAGE_SIZE);134106 brelse(bh);107107+ if (err)108108+ goto out_unlock_inode;135109136110 up_read(&iinfo->i_data_sem);137111 SetPageUptodate(page);···143109 unlock_page(page);144110 return 0;145111146146-out:112112+out_unlock_inode:147113 up_read(&iinfo->i_data_sem);148114 SetPageError(page);115115+out_unmap:149116 kunmap(page);150117 unlock_page(page);151118 return err;
+2-1
fs/udf/udfdecl.h
···211211}212212213213/* unicode.c */214214-extern int udf_get_filename(struct super_block *, uint8_t *, uint8_t *, int);214214+extern int udf_get_filename(struct super_block *, uint8_t *, int, uint8_t *,215215+ int);215216extern int udf_put_filename(struct super_block *, const uint8_t *, uint8_t *,216217 int);217218extern int udf_build_ustr(struct ustr *, dstring *, int);
+16-12
fs/udf/unicode.c
···28282929#include "udf_sb.h"30303131-static int udf_translate_to_linux(uint8_t *, uint8_t *, int, uint8_t *, int);3131+static int udf_translate_to_linux(uint8_t *, int, uint8_t *, int, uint8_t *,3232+ int);32333334static int udf_char_to_ustr(struct ustr *dest, const uint8_t *src, int strlen)3435{···334333 return u_len + 1;335334}336335337337-int udf_get_filename(struct super_block *sb, uint8_t *sname, uint8_t *dname,338338- int flen)336336+int udf_get_filename(struct super_block *sb, uint8_t *sname, int slen,337337+ uint8_t *dname, int dlen)339338{340339 struct ustr *filename, *unifilename;341340 int len = 0;···348347 if (!unifilename)349348 goto out1;350349351351- if (udf_build_ustr_exact(unifilename, sname, flen))350350+ if (udf_build_ustr_exact(unifilename, sname, slen))352351 goto out2;353352354353 if (UDF_QUERY_FLAG(sb, UDF_FLAG_UTF8)) {···367366 } else368367 goto out2;369368370370- len = udf_translate_to_linux(dname, filename->u_name, filename->u_len,369369+ len = udf_translate_to_linux(dname, dlen,370370+ filename->u_name, filename->u_len,371371 unifilename->u_name, unifilename->u_len);372372out2:373373 kfree(unifilename);···405403#define EXT_MARK '.'406404#define CRC_MARK '#'407405#define EXT_SIZE 5406406+/* Number of chars we need to store generated CRC to make filename unique */407407+#define CRC_LEN 5408408409409-static int udf_translate_to_linux(uint8_t *newName, uint8_t *udfName,410410- int udfLen, uint8_t *fidName,411411- int fidNameLen)409409+static int udf_translate_to_linux(uint8_t *newName, int newLen,410410+ uint8_t *udfName, int udfLen,411411+ uint8_t *fidName, int fidNameLen)412412{413413 int index, newIndex = 0, needsCRC = 0;414414 int extIndex = 0, newExtIndex = 0, hasExt = 0;···443439 newExtIndex = newIndex;444440 }445441 }446446- if (newIndex < 256)442442+ if (newIndex < newLen)447443 newName[newIndex++] = curr;448444 else449445 needsCRC = 1;···471467 }472468 ext[localExtIndex++] = curr;473469 }474474- maxFilenameLen = 250 - localExtIndex;470470+ maxFilenameLen = newLen - CRC_LEN - localExtIndex;475471 if (newIndex > maxFilenameLen)476472 newIndex = maxFilenameLen;477473 else478474 newIndex = newExtIndex;479479- } else if (newIndex > 250)480480- newIndex = 250;475475+ } else if (newIndex > newLen - CRC_LEN)476476+ newIndex = newLen - CRC_LEN;481477 newName[newIndex++] = CRC_MARK;482478 valueCRC = crc_itu_t(0, fidName, fidNameLen);483479 newName[newIndex++] = hex_asc_upper_hi(valueCRC >> 8);
+4
include/drm/drmP.h
···901901extern int drm_wait_vblank(struct drm_device *dev, void *data,902902 struct drm_file *filp);903903extern u32 drm_vblank_count(struct drm_device *dev, int crtc);904904+extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);904905extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc,905906 struct timeval *vblanktime);906907extern void drm_send_vblank_event(struct drm_device *dev, int crtc,907908 struct drm_pending_vblank_event *e);909909+extern void drm_crtc_send_vblank_event(struct drm_crtc *crtc,910910+ struct drm_pending_vblank_event *e);908911extern bool drm_handle_vblank(struct drm_device *dev, int crtc);912912+extern bool drm_crtc_handle_vblank(struct drm_crtc *crtc);909913extern int drm_vblank_get(struct drm_device *dev, int crtc);910914extern void drm_vblank_put(struct drm_device *dev, int crtc);911915extern int drm_crtc_vblank_get(struct drm_crtc *crtc);
-7
include/drm/drm_gem.h
···119119 * simply leave it as NULL.120120 */121121 struct dma_buf_attachment *import_attach;122122-123123- /**124124- * dumb - created as dumb buffer125125- * Whether the gem object was created using the dumb buffer interface126126- * as such it may not be used for GPU rendering.127127- */128128- bool dumb;129122};130123131124void drm_gem_object_release(struct drm_gem_object *obj);
+1-1
include/dt-bindings/thermal/thermal.h
···1111#define _DT_BINDINGS_THERMAL_THERMAL_H12121313/* On cooling devices upper and lower limits */1414-#define THERMAL_NO_LIMIT (-1UL)1414+#define THERMAL_NO_LIMIT (~0)15151616#endif1717
+4
include/linux/audit.h
···47474848struct audit_krule {4949 int vers_ops;5050+ u32 pflags;5051 u32 flags;5152 u32 listnr;5253 u32 action;···6463 struct list_head list; /* for AUDIT_LIST* purposes only */6564 u64 prio;6665};6666+6767+/* Flag to indicate legacy AUDIT_LOGINUID unset usage */6868+#define AUDIT_LOGINUID_LEGACY 0x167696870struct audit_field {6971 u32 type;
···5353};54545555/* Idle State Flags */5656-#define CPUIDLE_FLAG_TIME_INVALID (0x01) /* is residency time measurable? */5756#define CPUIDLE_FLAG_COUPLED (0x02) /* state applies to multiple cpus */5857#define CPUIDLE_FLAG_TIMER_STOP (0x04) /* timer is stopped on this state */5958···8889/**8990 * cpuidle_get_last_residency - retrieves the last state's residency time9091 * @dev: the target CPU9191- *9292- * NOTE: this value is invalid if CPUIDLE_FLAG_TIME_INVALID is set9392 */9493static inline int cpuidle_get_last_residency(struct cpuidle_device *dev)9594{
+2-20
include/linux/mfd/stmpe.h
···5050 STMPE_IDX_GPEDR_MSB,5151 STMPE_IDX_GPRER_LSB,5252 STMPE_IDX_GPFER_LSB,5353+ STMPE_IDX_GPPUR_LSB,5454+ STMPE_IDX_GPPDR_LSB,5355 STMPE_IDX_GPAFR_U_MSB,5456 STMPE_IDX_IEGPIOR_LSB,5557 STMPE_IDX_ISGPIOR_LSB,···114112 enum stmpe_block block);115113extern int stmpe_enable(struct stmpe *stmpe, unsigned int blocks);116114extern int stmpe_disable(struct stmpe *stmpe, unsigned int blocks);117117-118118-struct matrix_keymap_data;119119-120120-/**121121- * struct stmpe_keypad_platform_data - STMPE keypad platform data122122- * @keymap_data: key map table and size123123- * @debounce_ms: debounce interval, in ms. Maximum is124124- * %STMPE_KEYPAD_MAX_DEBOUNCE.125125- * @scan_count: number of key scanning cycles to confirm key data.126126- * Maximum is %STMPE_KEYPAD_MAX_SCAN_COUNT.127127- * @no_autorepeat: disable key autorepeat128128- */129129-struct stmpe_keypad_platform_data {130130- const struct matrix_keymap_data *keymap_data;131131- unsigned int debounce_ms;132132- unsigned int scan_count;133133- bool no_autorepeat;134134-};135115136116#define STMPE_GPIO_NOREQ_811_TOUCH (0xf0)137117···183199 * @irq_gpio: gpio number over which irq will be requested (significant only if184200 * irq_over_gpio is true)185201 * @gpio: GPIO-specific platform data186186- * @keypad: keypad-specific platform data187202 * @ts: touchscreen-specific platform data188203 */189204struct stmpe_platform_data {···195212 int autosleep_timeout;196213197214 struct stmpe_gpio_platform_data *gpio;198198- struct stmpe_keypad_platform_data *keypad;199215 struct stmpe_ts_platform_data *ts;200216};201217
+11-9
include/linux/netdevice.h
···10121012 * Callback to use for xmit over the accelerated station. This10131013 * is used in place of ndo_start_xmit on accelerated net10141014 * devices.10151015- * bool (*ndo_gso_check) (struct sk_buff *skb,10161016- * struct net_device *dev);10151015+ * netdev_features_t (*ndo_features_check) (struct sk_buff *skb,10161016+ * struct net_device *dev10171017+ * netdev_features_t features);10171018 * Called by core transmit path to determine if device is capable of10181018- * performing GSO on a packet. The device returns true if it is10191019- * able to GSO the packet, false otherwise. If the return value is10201020- * false the stack will do software GSO.10191019+ * performing offload operations on a given packet. This is to give10201020+ * the device an opportunity to implement any restrictions that cannot10211021+ * be otherwise expressed by feature flags. The check is called with10221022+ * the set of features that the stack has calculated and it returns10231023+ * those the driver believes to be appropriate.10211024 *10221025 * int (*ndo_switch_parent_id_get)(struct net_device *dev,10231026 * struct netdev_phys_item_id *psid);···11811178 struct net_device *dev,11821179 void *priv);11831180 int (*ndo_get_lock_subclass)(struct net_device *dev);11841184- bool (*ndo_gso_check) (struct sk_buff *skb,11851185- struct net_device *dev);11811181+ netdev_features_t (*ndo_features_check) (struct sk_buff *skb,11821182+ struct net_device *dev,11831183+ netdev_features_t features);11861184#ifdef CONFIG_NET_SWITCHDEV11871185 int (*ndo_switch_parent_id_get)(struct net_device *dev,11881186 struct netdev_phys_item_id *psid);···36153611 netdev_features_t features)36163612{36173613 return skb_is_gso(skb) && (!skb_gso_ok(skb, features) ||36183618- (dev->netdev_ops->ndo_gso_check &&36193619- !dev->netdev_ops->ndo_gso_check(skb, dev)) ||36203614 unlikely((skb->ip_summed != CHECKSUM_PARTIAL) &&36213615 (skb->ip_summed != CHECKSUM_UNNECESSARY)));36223616}
+2-2
include/linux/netlink.h
···4646 unsigned int flags;4747 void (*input)(struct sk_buff *skb);4848 struct mutex *cb_mutex;4949- int (*bind)(int group);5050- void (*unbind)(int group);4949+ int (*bind)(struct net *net, int group);5050+ void (*unbind)(struct net *net, int group);5151 bool (*compare)(struct net *net, struct sock *sk);5252};5353
···3131 * do additional, common, filtering and return an error3232 * @post_doit: called after an operation's doit callback, it may3333 * undo operations done by pre_doit, for example release locks3434+ * @mcast_bind: a socket bound to the given multicast group (which3535+ * is given as the offset into the groups array)3636+ * @mcast_unbind: a socket was unbound from the given multicast group3437 * @attrbuf: buffer to store parsed attributes3538 * @family_list: family list3639 * @mcgrps: multicast groups used by this family (private)···5653 void (*post_doit)(const struct genl_ops *ops,5754 struct sk_buff *skb,5855 struct genl_info *info);5656+ int (*mcast_bind)(struct net *net, int group);5757+ void (*mcast_unbind)(struct net *net, int group);5958 struct nlattr ** attrbuf; /* private */6059 const struct genl_ops * ops; /* private */6160 const struct genl_multicast_group *mcgrps; /* private */···400395}401396402397static inline int genl_has_listeners(struct genl_family *family,403403- struct sock *sk, unsigned int group)398398+ struct net *net, unsigned int group)404399{405400 if (WARN_ON_ONCE(group >= family->n_mcgrps))406401 return -EINVAL;407402 group = family->mcgrp_offset + group;408408- return netlink_has_listeners(sk, group);403403+ return netlink_has_listeners(net->genl_sock, group);409404}410405#endif /* __NET_GENERIC_NETLINK_H */
···857857}858858859859/**860860- * params_channels - Get the sample rate from the hw params860860+ * params_rate - Get the sample rate from the hw params861861 * @p: hw params862862 */863863static inline unsigned int params_rate(const struct snd_pcm_hw_params *p)···866866}867867868868/**869869- * params_channels - Get the period size (in frames) from the hw params869869+ * params_period_size - Get the period size (in frames) from the hw params870870 * @p: hw params871871 */872872static inline unsigned int params_period_size(const struct snd_pcm_hw_params *p)···875875}876876877877/**878878- * params_channels - Get the number of periods from the hw params878878+ * params_periods - Get the number of periods from the hw params879879 * @p: hw params880880 */881881static inline unsigned int params_periods(const struct snd_pcm_hw_params *p)···884884}885885886886/**887887- * params_channels - Get the buffer size (in frames) from the hw params887887+ * params_buffer_size - Get the buffer size (in frames) from the hw params888888 * @p: hw params889889 */890890static inline unsigned int params_buffer_size(const struct snd_pcm_hw_params *p)···893893}894894895895/**896896- * params_channels - Get the buffer size (in bytes) from the hw params896896+ * params_buffer_bytes - Get the buffer size (in bytes) from the hw params897897 * @p: hw params898898 */899899static inline unsigned int params_buffer_bytes(const struct snd_pcm_hw_params *p)
···101101 struct vring_used *used;102102};103103104104+/* Alignment requirements for vring elements.105105+ * When using pre-virtio 1.0 layout, these fall out naturally.106106+ */107107+#define VRING_AVAIL_ALIGN_SIZE 2108108+#define VRING_USED_ALIGN_SIZE 4109109+#define VRING_DESC_ALIGN_SIZE 16110110+104111/* The standard layout for the ring is a continuous chunk of memory which looks105112 * like this. We assume num is a power of 2.106113 *
+5-5
kernel/audit.c
···429429 * This function doesn't consume an skb as might be expected since it has to430430 * copy it anyways.431431 */432432-static void kauditd_send_multicast_skb(struct sk_buff *skb)432432+static void kauditd_send_multicast_skb(struct sk_buff *skb, gfp_t gfp_mask)433433{434434 struct sk_buff *copy;435435 struct audit_net *aunet = net_generic(&init_net, audit_net_id);···448448 * no reason for new multicast clients to continue with this449449 * non-compliance.450450 */451451- copy = skb_copy(skb, GFP_KERNEL);451451+ copy = skb_copy(skb, gfp_mask);452452 if (!copy)453453 return;454454455455- nlmsg_multicast(sock, copy, 0, AUDIT_NLGRP_READLOG, GFP_KERNEL);455455+ nlmsg_multicast(sock, copy, 0, AUDIT_NLGRP_READLOG, gfp_mask);456456}457457458458/*···11001100}1101110111021102/* Run custom bind function on netlink socket group connect or bind requests. */11031103-static int audit_bind(int group)11031103+static int audit_bind(struct net *net, int group)11041104{11051105 if (!capable(CAP_AUDIT_READ))11061106 return -EPERM;···19401940 struct nlmsghdr *nlh = nlmsg_hdr(ab->skb);1941194119421942 nlh->nlmsg_len = ab->skb->len;19431943- kauditd_send_multicast_skb(ab->skb);19431943+ kauditd_send_multicast_skb(ab->skb, ab->gfp_mask);1944194419451945 /*19461946 * The original kaudit unicast socket sends up messages with
···7272#include <linux/fs_struct.h>7373#include <linux/compat.h>7474#include <linux/ctype.h>7575+#include <linux/string.h>7676+#include <uapi/linux/limits.h>75777678#include "audit.h"7779···18631861 }1864186218651863 list_for_each_entry_reverse(n, &context->names_list, list) {18661866- /* does the name pointer match? */18671867- if (!n->name || n->name->name != name->name)18641864+ if (!n->name || strcmp(n->name->name, name->name))18681865 continue;1869186618701867 /* match the correct record type */···18781877 }1879187818801879out_alloc:18811881- /* unable to find the name from a previous getname(). Allocate a new18821882- * anonymous entry.18831883- */18841884- n = audit_alloc_name(context, AUDIT_TYPE_NORMAL);18801880+ /* unable to find an entry with both a matching name and type */18811881+ n = audit_alloc_name(context, AUDIT_TYPE_UNKNOWN);18851882 if (!n)18861883 return;18841884+ /* unfortunately, while we may have a path name to record with the18851885+ * inode, we can't always rely on the string lasting until the end of18861886+ * the syscall so we need to create our own copy, it may fail due to18871887+ * memory allocation issues, but we do our best */18881888+ if (name) {18891889+ /* we can't use getname_kernel() due to size limits */18901890+ size_t len = strlen(name->name) + 1;18911891+ struct filename *new = __getname();18921892+18931893+ if (unlikely(!new))18941894+ goto out;18951895+18961896+ if (len <= (PATH_MAX - sizeof(*new))) {18971897+ new->name = (char *)(new) + sizeof(*new);18981898+ new->separate = false;18991899+ } else if (len <= PATH_MAX) {19001900+ /* this looks odd, but is due to final_putname() */19011901+ struct filename *new2;19021902+19031903+ new2 = kmalloc(sizeof(*new2), GFP_KERNEL);19041904+ if (unlikely(!new2)) {19051905+ __putname(new);19061906+ goto out;19071907+ }19081908+ new2->name = (char *)new;19091909+ new2->separate = true;19101910+ new = new2;19111911+ } else {19121912+ /* we should never get here, but let's be safe */19131913+ __putname(new);19141914+ goto out;19151915+ }19161916+ strlcpy((char *)new->name, name->name, len);19171917+ new->uptr = NULL;19181918+ new->aname = n;19191919+ n->name = new;19201920+ n->name_put = true;19211921+ }18871922out:18881923 if (parent) {18891924 n->name_len = n->name ? parent_len(n->name->name) : AUDIT_NAME_FULL;
+12-17
mm/filemap.c
···10461046 * @mapping: the address_space to search10471047 * @offset: the page index10481048 * @fgp_flags: PCG flags10491049- * @cache_gfp_mask: gfp mask to use for the page cache data page allocation10501050- * @radix_gfp_mask: gfp mask to use for radix tree node allocation10491049+ * @gfp_mask: gfp mask to use for the page cache data page allocation10511050 *10521051 * Looks up the page cache slot at @mapping & @offset.10531052 *···10551056 * FGP_ACCESSED: the page will be marked accessed10561057 * FGP_LOCK: Page is return locked10571058 * FGP_CREAT: If page is not present then a new page is allocated using10581058- * @cache_gfp_mask and added to the page cache and the VM's LRU10591059- * list. If radix tree nodes are allocated during page cache10601060- * insertion then @radix_gfp_mask is used. The page is returned10611061- * locked and with an increased refcount. Otherwise, %NULL is10621062- * returned.10591059+ * @gfp_mask and added to the page cache and the VM's LRU10601060+ * list. The page is returned locked and with an increased10611061+ * refcount. Otherwise, %NULL is returned.10631062 *10641063 * If FGP_LOCK or FGP_CREAT are specified then the function may sleep even10651064 * if the GFP flags specified for FGP_CREAT are atomic.···10651068 * If there is a page cache page, it is returned with an increased refcount.10661069 */10671070struct page *pagecache_get_page(struct address_space *mapping, pgoff_t offset,10681068- int fgp_flags, gfp_t cache_gfp_mask, gfp_t radix_gfp_mask)10711071+ int fgp_flags, gfp_t gfp_mask)10691072{10701073 struct page *page;10711074···11021105 if (!page && (fgp_flags & FGP_CREAT)) {11031106 int err;11041107 if ((fgp_flags & FGP_WRITE) && mapping_cap_account_dirty(mapping))11051105- cache_gfp_mask |= __GFP_WRITE;11061106- if (fgp_flags & FGP_NOFS) {11071107- cache_gfp_mask &= ~__GFP_FS;11081108- radix_gfp_mask &= ~__GFP_FS;11091109- }11081108+ gfp_mask |= __GFP_WRITE;11091109+ if (fgp_flags & FGP_NOFS)11101110+ gfp_mask &= ~__GFP_FS;1110111111111111- page = __page_cache_alloc(cache_gfp_mask);11121112+ page = __page_cache_alloc(gfp_mask);11121113 if (!page)11131114 return NULL;11141115···11171122 if (fgp_flags & FGP_ACCESSED)11181123 __SetPageReferenced(page);1119112411201120- err = add_to_page_cache_lru(page, mapping, offset, radix_gfp_mask);11251125+ err = add_to_page_cache_lru(page, mapping, offset,11261126+ gfp_mask & GFP_RECLAIM_MASK);11211127 if (unlikely(err)) {11221128 page_cache_release(page);11231129 page = NULL;···24392443 fgp_flags |= FGP_NOFS;2440244424412445 page = pagecache_get_page(mapping, index, fgp_flags,24422442- mapping_gfp_mask(mapping),24432443- GFP_KERNEL);24462446+ mapping_gfp_mask(mapping));24442447 if (page)24452448 wait_for_stable_page(page);24462449
+2-2
mm/memory.c
···23782378 details.last_index = ULONG_MAX;237923792380238023812381- i_mmap_lock_read(mapping);23812381+ i_mmap_lock_write(mapping);23822382 if (unlikely(!RB_EMPTY_ROOT(&mapping->i_mmap)))23832383 unmap_mapping_range_tree(&mapping->i_mmap, &details);23842384 if (unlikely(!list_empty(&mapping->i_mmap_nonlinear)))23852385 unmap_mapping_range_list(&mapping->i_mmap_nonlinear, &details);23862386- i_mmap_unlock_read(mapping);23862386+ i_mmap_unlock_write(mapping);23872387}23882388EXPORT_SYMBOL(unmap_mapping_range);23892389
+2-2
net/batman-adv/fragmentation.c
···251251 kfree(entry);252252253253 /* Make room for the rest of the fragments. */254254- if (pskb_expand_head(skb_out, 0, size - skb->len, GFP_ATOMIC) < 0) {254254+ if (pskb_expand_head(skb_out, 0, size - skb_out->len, GFP_ATOMIC) < 0) {255255 kfree_skb(skb_out);256256 skb_out = NULL;257257 goto free;···434434 * fragments larger than BATADV_FRAG_MAX_FRAG_SIZE435435 */436436 mtu = min_t(unsigned, mtu, BATADV_FRAG_MAX_FRAG_SIZE);437437- max_fragment_size = (mtu - header_size - ETH_HLEN);437437+ max_fragment_size = mtu - header_size;438438 max_packet_size = max_fragment_size * BATADV_FRAG_MAX_FRAGMENTS;439439440440 /* Don't even try to fragment, if we need more than 16 fragments */
+1-1
net/batman-adv/gateway_client.c
···810810 goto out;811811812812 gw_node = batadv_gw_node_get(bat_priv, orig_dst_node);813813- if (!gw_node->bandwidth_down == 0)813813+ if (!gw_node)814814 goto out;815815816816 switch (atomic_read(&bat_priv->gw_mode)) {
···334334335335 BT_DBG("");336336337337+ if (!l2cap_is_socket(sock))338338+ return -EBADFD;339339+337340 session = kzalloc(sizeof(struct cmtp_session), GFP_KERNEL);338341 if (!session)339342 return -ENOMEM;
+12-4
net/bluetooth/hci_event.c
···242242 if (rp->status)243243 return;244244245245- if (test_bit(HCI_SETUP, &hdev->dev_flags))245245+ if (test_bit(HCI_SETUP, &hdev->dev_flags) ||246246+ test_bit(HCI_CONFIG, &hdev->dev_flags))246247 memcpy(hdev->dev_name, rp->name, HCI_MAX_NAME_LENGTH);247248}248249···510509 if (rp->status)511510 return;512511513513- if (test_bit(HCI_SETUP, &hdev->dev_flags)) {512512+ if (test_bit(HCI_SETUP, &hdev->dev_flags) ||513513+ test_bit(HCI_CONFIG, &hdev->dev_flags)) {514514 hdev->hci_ver = rp->hci_ver;515515 hdev->hci_rev = __le16_to_cpu(rp->hci_rev);516516 hdev->lmp_ver = rp->lmp_ver;···530528 if (rp->status)531529 return;532530533533- if (test_bit(HCI_SETUP, &hdev->dev_flags))531531+ if (test_bit(HCI_SETUP, &hdev->dev_flags) ||532532+ test_bit(HCI_CONFIG, &hdev->dev_flags))534533 memcpy(hdev->commands, rp->commands, sizeof(hdev->commands));535534}536535···21972194 return;21982195 }2199219622002200- if (!test_bit(HCI_CONNECTABLE, &hdev->dev_flags) &&21972197+ /* Require HCI_CONNECTABLE or a whitelist entry to accept the21982198+ * connection. These features are only touched through mgmt so21992199+ * only do the checks if HCI_MGMT is set.22002200+ */22012201+ if (test_bit(HCI_MGMT, &hdev->dev_flags) &&22022202+ !test_bit(HCI_CONNECTABLE, &hdev->dev_flags) &&22012203 !hci_bdaddr_list_lookup(&hdev->whitelist, &ev->bdaddr,22022204 BDADDR_BREDR)) {22032205 hci_reject_conn(hdev, &ev->bdaddr);
+2-1
net/bluetooth/hidp/core.c
···13141314{13151315 struct hidp_session *session;13161316 struct l2cap_conn *conn;13171317- struct l2cap_chan *chan = l2cap_pi(ctrl_sock->sk)->chan;13171317+ struct l2cap_chan *chan;13181318 int ret;1319131913201320 ret = hidp_verify_sockets(ctrl_sock, intr_sock);13211321 if (ret)13221322 return ret;1323132313241324+ chan = l2cap_pi(ctrl_sock->sk)->chan;13241325 conn = NULL;13251326 l2cap_chan_lock(chan);13261327 if (chan->conn)
+100-75
net/core/dev.c
···1694169416951695 skb_scrub_packet(skb, true);16961696 skb->protocol = eth_type_trans(skb, dev);16971697+ skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);1697169816981699 return 0;16991700}···25232522/* If MPLS offload request, verify we are testing hardware MPLS features25242523 * instead of standard features for the netdev.25252524 */25262526-#ifdef CONFIG_NET_MPLS_GSO25252525+#if IS_ENABLED(CONFIG_NET_MPLS_GSO)25272526static netdev_features_t net_mpls_features(struct sk_buff *skb,25282527 netdev_features_t features,25292528 __be16 type)···2563256225642563netdev_features_t netif_skb_features(struct sk_buff *skb)25652564{25662566- const struct net_device *dev = skb->dev;25652565+ struct net_device *dev = skb->dev;25672566 netdev_features_t features = dev->features;25682567 u16 gso_segs = skb_shinfo(skb)->gso_segs;25692568 __be16 protocol = skb->protocol;···25712570 if (gso_segs > dev->gso_max_segs || gso_segs < dev->gso_min_segs)25722571 features &= ~NETIF_F_GSO_MASK;2573257225742574- if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD)) {25752575- struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;25762576- protocol = veh->h_vlan_encapsulated_proto;25772577- } else if (!vlan_tx_tag_present(skb)) {25782578- return harmonize_features(skb, features);25732573+ /* If encapsulation offload request, verify we are testing25742574+ * hardware encapsulation features instead of standard25752575+ * features for the netdev25762576+ */25772577+ if (skb->encapsulation)25782578+ features &= dev->hw_enc_features;25792579+25802580+ if (!vlan_tx_tag_present(skb)) {25812581+ if (unlikely(protocol == htons(ETH_P_8021Q) ||25822582+ protocol == htons(ETH_P_8021AD))) {25832583+ struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;25842584+ protocol = veh->h_vlan_encapsulated_proto;25852585+ } else {25862586+ goto finalize;25872587+ }25792588 }2580258925812590 features = netdev_intersect_features(features,···26012590 NETIF_F_GEN_CSUM |26022591 NETIF_F_HW_VLAN_CTAG_TX |26032592 NETIF_F_HW_VLAN_STAG_TX);25932593+25942594+finalize:25952595+ if (dev->netdev_ops->ndo_features_check)25962596+ features &= dev->netdev_ops->ndo_features_check(skb, dev,25972597+ features);2604259826052599 return harmonize_features(skb, features);26062600}···26772661 if (unlikely(!skb))26782662 goto out_null;2679266326802680- /* If encapsulation offload request, verify we are testing26812681- * hardware encapsulation features instead of standard26822682- * features for the netdev26832683- */26842684- if (skb->encapsulation)26852685- features &= dev->hw_enc_features;26862686-26872664 if (netif_needs_gso(dev, skb, features)) {26882665 struct sk_buff *segs;2689266626902667 segs = skb_gso_segment(skb, features);26912668 if (IS_ERR(segs)) {26922692- segs = NULL;26692669+ goto out_kfree_skb;26932670 } else if (segs) {26942671 consume_skb(skb);26952672 skb = segs;···45664557}45674558EXPORT_SYMBOL(netif_napi_del);4568455945604560+static int napi_poll(struct napi_struct *n, struct list_head *repoll)45614561+{45624562+ void *have;45634563+ int work, weight;45644564+45654565+ list_del_init(&n->poll_list);45664566+45674567+ have = netpoll_poll_lock(n);45684568+45694569+ weight = n->weight;45704570+45714571+ /* This NAPI_STATE_SCHED test is for avoiding a race45724572+ * with netpoll's poll_napi(). Only the entity which45734573+ * obtains the lock and sees NAPI_STATE_SCHED set will45744574+ * actually make the ->poll() call. Therefore we avoid45754575+ * accidentally calling ->poll() when NAPI is not scheduled.45764576+ */45774577+ work = 0;45784578+ if (test_bit(NAPI_STATE_SCHED, &n->state)) {45794579+ work = n->poll(n, weight);45804580+ trace_napi_poll(n);45814581+ }45824582+45834583+ WARN_ON_ONCE(work > weight);45844584+45854585+ if (likely(work < weight))45864586+ goto out_unlock;45874587+45884588+ /* Drivers must not modify the NAPI state if they45894589+ * consume the entire weight. In such cases this code45904590+ * still "owns" the NAPI instance and therefore can45914591+ * move the instance around on the list at-will.45924592+ */45934593+ if (unlikely(napi_disable_pending(n))) {45944594+ napi_complete(n);45954595+ goto out_unlock;45964596+ }45974597+45984598+ if (n->gro_list) {45994599+ /* flush too old packets46004600+ * If HZ < 1000, flush all packets.46014601+ */46024602+ napi_gro_flush(n, HZ >= 1000);46034603+ }46044604+46054605+ /* Some drivers may have called napi_schedule46064606+ * prior to exhausting their budget.46074607+ */46084608+ if (unlikely(!list_empty(&n->poll_list))) {46094609+ pr_warn_once("%s: Budget exhausted after napi rescheduled\n",46104610+ n->dev ? n->dev->name : "backlog");46114611+ goto out_unlock;46124612+ }46134613+46144614+ list_add_tail(&n->poll_list, repoll);46154615+46164616+out_unlock:46174617+ netpoll_poll_unlock(have);46184618+46194619+ return work;46204620+}46214621+45694622static void net_rx_action(struct softirq_action *h)45704623{45714624 struct softnet_data *sd = this_cpu_ptr(&softnet_data);···46354564 int budget = netdev_budget;46364565 LIST_HEAD(list);46374566 LIST_HEAD(repoll);46384638- void *have;4639456746404568 local_irq_disable();46414569 list_splice_init(&sd->poll_list, &list);46424570 local_irq_enable();4643457146444644- while (!list_empty(&list)) {45724572+ for (;;) {46454573 struct napi_struct *n;46464646- int work, weight;45744574+45754575+ if (list_empty(&list)) {45764576+ if (!sd_has_rps_ipi_waiting(sd) && list_empty(&repoll))45774577+ return;45784578+ break;45794579+ }45804580+45814581+ n = list_first_entry(&list, struct napi_struct, poll_list);45824582+ budget -= napi_poll(n, &repoll);4647458346484584 /* If softirq window is exhausted then punt.46494585 * Allow this to run for 2 jiffies since which will allow46504586 * an average latency of 1.5/HZ.46514587 */46524652- if (unlikely(budget <= 0 || time_after_eq(jiffies, time_limit)))46534653- goto softnet_break;46544654-46554655-46564656- n = list_first_entry(&list, struct napi_struct, poll_list);46574657- list_del_init(&n->poll_list);46584658-46594659- have = netpoll_poll_lock(n);46604660-46614661- weight = n->weight;46624662-46634663- /* This NAPI_STATE_SCHED test is for avoiding a race46644664- * with netpoll's poll_napi(). Only the entity which46654665- * obtains the lock and sees NAPI_STATE_SCHED set will46664666- * actually make the ->poll() call. Therefore we avoid46674667- * accidentally calling ->poll() when NAPI is not scheduled.46684668- */46694669- work = 0;46704670- if (test_bit(NAPI_STATE_SCHED, &n->state)) {46714671- work = n->poll(n, weight);46724672- trace_napi_poll(n);45884588+ if (unlikely(budget <= 0 ||45894589+ time_after_eq(jiffies, time_limit))) {45904590+ sd->time_squeeze++;45914591+ break;46734592 }46744674-46754675- WARN_ON_ONCE(work > weight);46764676-46774677- budget -= work;46784678-46794679- /* Drivers must not modify the NAPI state if they46804680- * consume the entire weight. In such cases this code46814681- * still "owns" the NAPI instance and therefore can46824682- * move the instance around on the list at-will.46834683- */46844684- if (unlikely(work == weight)) {46854685- if (unlikely(napi_disable_pending(n))) {46864686- napi_complete(n);46874687- } else {46884688- if (n->gro_list) {46894689- /* flush too old packets46904690- * If HZ < 1000, flush all packets.46914691- */46924692- napi_gro_flush(n, HZ >= 1000);46934693- }46944694- list_add_tail(&n->poll_list, &repoll);46954695- }46964696- }46974697-46984698- netpoll_poll_unlock(have);46994593 }4700459447014701- if (!sd_has_rps_ipi_waiting(sd) &&47024702- list_empty(&list) &&47034703- list_empty(&repoll))47044704- return;47054705-out:47064595 local_irq_disable();4707459647084597 list_splice_tail_init(&sd->poll_list, &list);···46724641 __raise_softirq_irqoff(NET_RX_SOFTIRQ);4673464246744643 net_rps_action_and_irq_enable(sd);46754675-46764676- return;46774677-46784678-softnet_break:46794679- sd->time_squeeze++;46804680- goto out;46814644}4682464546834646struct netdev_adjacent {
···463463}464464465465#ifdef CONFIG_MODULES466466-static int nfnetlink_bind(int group)466466+static int nfnetlink_bind(struct net *net, int group)467467{468468 const struct nfnetlink_subsystem *ss;469469 int type;
+23-15
net/netlink/af_netlink.c
···10911091 mutex_unlock(&nl_sk_hash_lock);1092109210931093 netlink_table_grab();10941094- if (nlk_sk(sk)->subscriptions)10941094+ if (nlk_sk(sk)->subscriptions) {10951095 __sk_del_bind_node(sk);10961096+ netlink_update_listeners(sk);10971097+ }10961098 netlink_table_ungrab();10971099}10981100···11411139 struct module *module = NULL;11421140 struct mutex *cb_mutex;11431141 struct netlink_sock *nlk;11441144- int (*bind)(int group);11451145- void (*unbind)(int group);11421142+ int (*bind)(struct net *net, int group);11431143+ void (*unbind)(struct net *net, int group);11461144 int err = 0;1147114511481146 sock->state = SS_UNCONNECTED;···1228122612291227 module_put(nlk->module);1230122812311231- netlink_table_grab();12321229 if (netlink_is_kernel(sk)) {12301230+ netlink_table_grab();12331231 BUG_ON(nl_table[sk->sk_protocol].registered == 0);12341232 if (--nl_table[sk->sk_protocol].registered == 0) {12351233 struct listeners *old;···12431241 nl_table[sk->sk_protocol].flags = 0;12441242 nl_table[sk->sk_protocol].registered = 0;12451243 }12461246- } else if (nlk->subscriptions) {12471247- netlink_update_listeners(sk);12441244+ netlink_table_ungrab();12481245 }12491249- netlink_table_ungrab();1250124612471247+ if (nlk->netlink_unbind) {12481248+ int i;12491249+12501250+ for (i = 0; i < nlk->ngroups; i++)12511251+ if (test_bit(i, nlk->groups))12521252+ nlk->netlink_unbind(sock_net(sk), i + 1);12531253+ }12511254 kfree(nlk->groups);12521255 nlk->groups = NULL;12531256···14171410 return err;14181411}1419141214201420-static void netlink_unbind(int group, long unsigned int groups,14211421- struct netlink_sock *nlk)14131413+static void netlink_undo_bind(int group, long unsigned int groups,14141414+ struct sock *sk)14221415{14161416+ struct netlink_sock *nlk = nlk_sk(sk);14231417 int undo;1424141814251419 if (!nlk->netlink_unbind)···1428142014291421 for (undo = 0; undo < group; undo++)14301422 if (test_bit(undo, &groups))14311431- nlk->netlink_unbind(undo);14231423+ nlk->netlink_unbind(sock_net(sk), undo);14321424}1433142514341426static int netlink_bind(struct socket *sock, struct sockaddr *addr,···14661458 for (group = 0; group < nlk->ngroups; group++) {14671459 if (!test_bit(group, &groups))14681460 continue;14691469- err = nlk->netlink_bind(group);14611461+ err = nlk->netlink_bind(net, group);14701462 if (!err)14711463 continue;14721472- netlink_unbind(group, groups, nlk);14641464+ netlink_undo_bind(group, groups, sk);14731465 return err;14741466 }14751467 }···14791471 netlink_insert(sk, net, nladdr->nl_pid) :14801472 netlink_autobind(sock);14811473 if (err) {14821482- netlink_unbind(nlk->ngroups, groups, nlk);14741474+ netlink_undo_bind(nlk->ngroups, groups, sk);14831475 return err;14841476 }14851477 }···21302122 if (!val || val - 1 >= nlk->ngroups)21312123 return -EINVAL;21322124 if (optname == NETLINK_ADD_MEMBERSHIP && nlk->netlink_bind) {21332133- err = nlk->netlink_bind(val);21252125+ err = nlk->netlink_bind(sock_net(sk), val);21342126 if (err)21352127 return err;21362128 }···21392131 optname == NETLINK_ADD_MEMBERSHIP);21402132 netlink_table_ungrab();21412133 if (optname == NETLINK_DROP_MEMBERSHIP && nlk->netlink_unbind)21422142- nlk->netlink_unbind(val);21342134+ nlk->netlink_unbind(sock_net(sk), val);2143213521442136 err = 0;21452137 break;
+4-4
net/netlink/af_netlink.h
···3939 struct mutex *cb_mutex;4040 struct mutex cb_def_mutex;4141 void (*netlink_rcv)(struct sk_buff *skb);4242- int (*netlink_bind)(int group);4343- void (*netlink_unbind)(int group);4242+ int (*netlink_bind)(struct net *net, int group);4343+ void (*netlink_unbind)(struct net *net, int group);4444 struct module *module;4545#ifdef CONFIG_NETLINK_MMAP4646 struct mutex pg_vec_lock;···6565 unsigned int groups;6666 struct mutex *cb_mutex;6767 struct module *module;6868- int (*bind)(int group);6969- void (*unbind)(int group);6868+ int (*bind)(struct net *net, int group);6969+ void (*unbind)(struct net *net, int group);7070 bool (*compare)(struct net *net, struct sock *sock);7171 int registered;7272};
+56
net/netlink/genetlink.c
···983983 { .name = "notify", },984984};985985986986+static int genl_bind(struct net *net, int group)987987+{988988+ int i, err = 0;989989+990990+ down_read(&cb_lock);991991+ for (i = 0; i < GENL_FAM_TAB_SIZE; i++) {992992+ struct genl_family *f;993993+994994+ list_for_each_entry(f, genl_family_chain(i), family_list) {995995+ if (group >= f->mcgrp_offset &&996996+ group < f->mcgrp_offset + f->n_mcgrps) {997997+ int fam_grp = group - f->mcgrp_offset;998998+999999+ if (!f->netnsok && net != &init_net)10001000+ err = -ENOENT;10011001+ else if (f->mcast_bind)10021002+ err = f->mcast_bind(net, fam_grp);10031003+ else10041004+ err = 0;10051005+ break;10061006+ }10071007+ }10081008+ }10091009+ up_read(&cb_lock);10101010+10111011+ return err;10121012+}10131013+10141014+static void genl_unbind(struct net *net, int group)10151015+{10161016+ int i;10171017+ bool found = false;10181018+10191019+ down_read(&cb_lock);10201020+ for (i = 0; i < GENL_FAM_TAB_SIZE; i++) {10211021+ struct genl_family *f;10221022+10231023+ list_for_each_entry(f, genl_family_chain(i), family_list) {10241024+ if (group >= f->mcgrp_offset &&10251025+ group < f->mcgrp_offset + f->n_mcgrps) {10261026+ int fam_grp = group - f->mcgrp_offset;10271027+10281028+ if (f->mcast_unbind)10291029+ f->mcast_unbind(net, fam_grp);10301030+ found = true;10311031+ break;10321032+ }10331033+ }10341034+ }10351035+ up_read(&cb_lock);10361036+10371037+ WARN_ON(!found);10381038+}10391039+9861040static int __net_init genl_pernet_init(struct net *net)9871041{9881042 struct netlink_kernel_cfg cfg = {9891043 .input = genl_rcv,9901044 .flags = NL_CFG_F_NONROOT_RECV,10451045+ .bind = genl_bind,10461046+ .unbind = genl_unbind,9911047 };99210489931049 /* we'll bump the group number right afterwards */
···785785786786 struct tpacket3_hdr *last_pkt;787787 struct tpacket_hdr_v1 *h1 = &pbd1->hdr.bh1;788788+ struct sock *sk = &po->sk;788789789790 if (po->stats.stats3.tp_drops)790791 status |= TP_STATUS_LOSING;···809808810809 /* Flush the block */811810 prb_flush_block(pkc1, pbd1, status);811811+812812+ sk->sk_data_ready(sk);812813813814 pkc1->kactive_blk_num = GET_NEXT_PRB_BLK_NUM(pkc1);814815}···20552052 smp_wmb();20562053#endif2057205420582058- if (po->tp_version <= TPACKET_V2)20552055+ if (po->tp_version <= TPACKET_V2) {20592056 __packet_set_status(po, h.raw, status);20602060- else20572057+ sk->sk_data_ready(sk);20582058+ } else {20612059 prb_clear_blk_fill_status(&po->rx_ring);20622062-20632063- sk->sk_data_ready(sk);20602060+ }2064206120652062drop_n_restore:20662063 if (skb_head != skb->data && skb_shared(skb)) {
+1-1
net/wireless/Kconfig
···175175 Most distributions have a CRDA package. So if unsure, say N.176176177177config CFG80211_WEXT178178- bool178178+ bool "cfg80211 wireless extensions compatibility"179179 depends on CFG80211180180 select WEXT_CORE181181 help
+22-2
sound/pci/hda/hda_controller.c
···19221922EXPORT_SYMBOL_GPL(azx_mixer_create);192319231924192419251925+static bool is_input_stream(struct azx *chip, unsigned char index)19261926+{19271927+ return (index >= chip->capture_index_offset &&19281928+ index < chip->capture_index_offset + chip->capture_streams);19291929+}19301930+19251931/* initialize SD streams */19261932int azx_init_stream(struct azx *chip)19271933{19281934 int i;19351935+ int in_stream_tag = 0;19361936+ int out_stream_tag = 0;1929193719301938 /* initialize each stream (aka device)19311939 * assign the starting bdl address to each stream (device)···19461938 azx_dev->sd_addr = chip->remap_addr + (0x20 * i + 0x80);19471939 /* int mask: SDI0=0x01, SDI1=0x02, ... SDO3=0x80 */19481940 azx_dev->sd_int_sta_mask = 1 << i;19491949- /* stream tag: must be non-zero and unique */19501941 azx_dev->index = i;19511951- azx_dev->stream_tag = i + 1;19421942+19431943+ /* stream tag must be unique throughout19441944+ * the stream direction group,19451945+ * valid values 1...1519461946+ * use separate stream tag if the flag19471947+ * AZX_DCAPS_SEPARATE_STREAM_TAG is used19481948+ */19491949+ if (chip->driver_caps & AZX_DCAPS_SEPARATE_STREAM_TAG)19501950+ azx_dev->stream_tag =19511951+ is_input_stream(chip, i) ?19521952+ ++in_stream_tag :19531953+ ++out_stream_tag;19541954+ else19551955+ azx_dev->stream_tag = i + 1;19521956 }1953195719541958 return 0;
···179179 */180180 fd = open(longpath, O_RDONLY);181181 if (fd > 0) {182182- printf("Invoke copy of '%s' via filename of length %lu:\n",182182+ printf("Invoke copy of '%s' via filename of length %zu:\n",183183 src, strlen(longpath));184184 fail += check_execveat(fd, "", AT_EMPTY_PATH);185185 } else {186186- printf("Failed to open length %lu filename, errno=%d (%s)\n",186186+ printf("Failed to open length %zu filename, errno=%d (%s)\n",187187 strlen(longpath), errno, strerror(errno));188188 fail++;189189 }
+20-6
virt/kvm/kvm_main.c
···671671672672 WARN_ON(mslots[i].id != id);673673 if (!new->npages) {674674+ WARN_ON(!mslots[i].npages);674675 new->base_gfn = 0;675676 if (mslots[i].npages)676677 slots->used_slots--;···688687 slots->id_to_index[mslots[i].id] = i;689688 i++;690689 }691691- while (i > 0 &&692692- new->base_gfn > mslots[i - 1].base_gfn) {693693- mslots[i] = mslots[i - 1];694694- slots->id_to_index[mslots[i].id] = i;695695- i--;696696- }690690+691691+ /*692692+ * The ">=" is needed when creating a slot with base_gfn == 0,693693+ * so that it moves before all those with base_gfn == npages == 0.694694+ *695695+ * On the other hand, if new->npages is zero, the above loop has696696+ * already left i pointing to the beginning of the empty part of697697+ * mslots, and the ">=" would move the hole backwards in this698698+ * case---which is wrong. So skip the loop when deleting a slot.699699+ */700700+ if (new->npages) {701701+ while (i > 0 &&702702+ new->base_gfn >= mslots[i - 1].base_gfn) {703703+ mslots[i] = mslots[i - 1];704704+ slots->id_to_index[mslots[i].id] = i;705705+ i--;706706+ }707707+ } else708708+ WARN_ON_ONCE(i != slots->used_slots);697709698710 mslots[i] = *new;699711 slots->id_to_index[mslots[i].id] = i;