···320320 return -EBUSY;321321}322322323323-/*324324- * If we set up a device for bus mastering, we need to check the latency325325- * timer as we don't have even crappy BIOSes to set it properly.326326- * The implementation is from arch/i386/pci/i386.c327327- */328328-unsigned int pcibios_max_latency = 255;329329-330323/* ITE bridge requires setting latency timer to avoid early bus access331324 termination by PCI bus master devices332325*/
+2-1
arch/arm/common/pl330.c
···15021502 struct pl330_thread *thrd = ch_id;15031503 struct pl330_dmac *pl330;15041504 unsigned long flags;15051505- int ret = 0, active = thrd->req_running;15051505+ int ret = 0, active;1506150615071507 if (!thrd || thrd->free || thrd->dmac->state == DYING)15081508 return -EINVAL;1509150915101510 pl330 = thrd->dmac;15111511+ active = thrd->req_running;1511151215121513 spin_lock_irqsave(&pl330->lock, flags);15131514
+5
arch/arm/include/asm/assembler.h
···137137 disable_irq138138 .endm139139140140+ .macro save_and_disable_irqs_notrace, oldcpsr141141+ mrs \oldcpsr, cpsr142142+ disable_irq_notrace143143+ .endm144144+140145/*141146 * Restore interrupt state previously stored in a register. We don't142147 * guarantee that this will preserve the flags.
+1-1
arch/arm/include/asm/hardware/pl330.h
···4141 DCCTRL1, /* Bufferable only */4242 DCCTRL2, /* Cacheable, but do not allocate */4343 DCCTRL3, /* Cacheable and bufferable, but do not allocate */4444- DINVALID1 = 8,4444+ DINVALID1, /* AWCACHE = 0x1000 */4545 DINVALID2,4646 DCCTRL6, /* Cacheable write-through, allocate on writes only */4747 DCCTRL7, /* Cacheable write-back, allocate on writes only */
···2323#include <linux/perf_event.h>2424#include <linux/hw_breakpoint.h>2525#include <linux/regset.h>2626+#include <linux/audit.h>26272728#include <asm/pgtable.h>2829#include <asm/system.h>···905904 return ret;906905}907906907907+#ifdef __ARMEB__908908+#define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB909909+#else910910+#define AUDIT_ARCH_NR AUDIT_ARCH_ARM911911+#endif912912+908913asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)909914{910915 unsigned long ip;···925918 if (!ip)926919 audit_syscall_exit(regs);927920 else928928- audit_syscall_entry(AUDIT_ARCH_ARMEB, scno, regs->ARM_r0,921921+ audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0,929922 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3);930923931924 if (!test_thread_flag(TIF_SYSCALL_TRACE))
+1-1
arch/arm/kernel/smp_twd.c
···129129130130static int twd_cpufreq_init(void)131131{132132- if (!IS_ERR(twd_clk))132132+ if (twd_evt && *__this_cpu_ptr(twd_evt) && !IS_ERR(twd_clk))133133 return cpufreq_register_notifier(&twd_cpufreq_nb,134134 CPUFREQ_TRANSITION_NOTIFIER);135135
···364364 going on could result in system crashes;365365366366config OMAP4_ERRATA_I688367367- bool "OMAP4 errata: Async Bridge Corruption (BROKEN)"368368- depends on ARCH_OMAP4 && BROKEN367367+ bool "OMAP4 errata: Async Bridge Corruption"368368+ depends on ARCH_OMAP4369369 select ARCH_HAS_BARRIERS370370 help371371 If a data is stalled inside asynchronous bridge because of back
+4
arch/arm/mach-omap2/board-n8x0.c
···371371 else372372 *openp = 0;373373374374+#ifdef CONFIG_MMC_OMAP374375 omap_mmc_notify_cover_event(mmc_device, index, *openp);376376+#else377377+ pr_warn("MMC: notify cover event not available\n");378378+#endif375379}376380377381static int n8x0_mmc_late_init(struct device *dev)
···6565 struct timespec ts_preidle, ts_postidle, ts_idle;6666 u32 cpu1_state;6767 int idle_time;6868- int new_state_idx;6968 int cpu_id = smp_processor_id();70697170 /* Used to keep track of the total time in idle */···8384 */8485 cpu1_state = pwrdm_read_pwrst(cpu1_pd);8586 if (cpu1_state != PWRDM_POWER_OFF) {8686- new_state_idx = drv->safe_state_index;8787- cx = cpuidle_get_statedata(&dev->states_usage[new_state_idx]);8787+ index = drv->safe_state_index;8888+ cx = cpuidle_get_statedata(&dev->states_usage[index]);8889 }89909091 if (index > 0)
+52
arch/arm/mach-omap2/gpmc-smsc911x.c
···1919#include <linux/interrupt.h>2020#include <linux/io.h>2121#include <linux/smsc911x.h>2222+#include <linux/regulator/fixed.h>2323+#include <linux/regulator/machine.h>22242325#include <plat/board.h>2426#include <plat/gpmc.h>···4442 .flags = SMSC911X_USE_16BIT,4543};46444545+static struct regulator_consumer_supply gpmc_smsc911x_supply[] = {4646+ REGULATOR_SUPPLY("vddvario", "smsc911x.0"),4747+ REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),4848+};4949+5050+/* Generic regulator definition to satisfy smsc911x */5151+static struct regulator_init_data gpmc_smsc911x_reg_init_data = {5252+ .constraints = {5353+ .min_uV = 3300000,5454+ .max_uV = 3300000,5555+ .valid_modes_mask = REGULATOR_MODE_NORMAL5656+ | REGULATOR_MODE_STANDBY,5757+ .valid_ops_mask = REGULATOR_CHANGE_MODE5858+ | REGULATOR_CHANGE_STATUS,5959+ },6060+ .num_consumer_supplies = ARRAY_SIZE(gpmc_smsc911x_supply),6161+ .consumer_supplies = gpmc_smsc911x_supply,6262+};6363+6464+static struct fixed_voltage_config gpmc_smsc911x_fixed_reg_data = {6565+ .supply_name = "gpmc_smsc911x",6666+ .microvolts = 3300000,6767+ .gpio = -EINVAL,6868+ .startup_delay = 0,6969+ .enable_high = 0,7070+ .enabled_at_boot = 1,7171+ .init_data = &gpmc_smsc911x_reg_init_data,7272+};7373+7474+/*7575+ * Platform device id of 42 is a temporary fix to avoid conflicts7676+ * with other reg-fixed-voltage devices. The real fix should7777+ * involve the driver core providing a way of dynamically7878+ * assigning a unique id on registration for platform devices7979+ * in the same name space.8080+ */8181+static struct platform_device gpmc_smsc911x_regulator = {8282+ .name = "reg-fixed-voltage",8383+ .id = 42,8484+ .dev = {8585+ .platform_data = &gpmc_smsc911x_fixed_reg_data,8686+ },8787+};8888+4789/*4890 * Initialize smsc911x device connected to the GPMC. Note that we4991 * assume that pin multiplexing is done in the board-*.c file,···10054 int ret;1015510256 gpmc_cfg = board_data;5757+5858+ ret = platform_device_register(&gpmc_smsc911x_regulator);5959+ if (ret < 0) {6060+ pr_err("Unable to register smsc911x regulators: %d\n", ret);6161+ return;6262+ }1036310464 if (gpmc_cs_request(gpmc_cfg->cs, SZ_16M, &cs_mem_base) < 0) {10565 pr_err("Failed to request GPMC mem region\n");
+6
arch/arm/mach-omap2/hsmmc.c
···428428 return 0;429429}430430431431+static int omap_hsmmc_done;431432#define MAX_OMAP_MMC_HWMOD_NAME_LEN 16432433433434void omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr)···491490void omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)492491{493492 u32 reg;493493+494494+ if (omap_hsmmc_done)495495+ return;496496+497497+ omap_hsmmc_done = 1;494498495499 if (!cpu_is_omap44xx()) {496500 if (cpu_is_omap2430()) {
···174174 freq = clk->rate;175175 clk_put(clk);176176177177+ rcu_read_lock();177178 opp = opp_find_freq_ceil(dev, &freq);178179 if (IS_ERR(opp)) {180180+ rcu_read_unlock();179181 pr_err("%s: unable to find boot up OPP for vdd_%s\n",180182 __func__, vdd_name);181183 goto exit;182184 }183185184186 bootup_volt = opp_get_voltage(opp);187187+ rcu_read_unlock();185188 if (!bootup_volt) {186189 pr_err("%s: unable to find voltage corresponding "187190 "to the bootup OPP for vdd_%s\n", __func__, vdd_name);
+3-3
arch/arm/mach-omap2/usb-host.c
···486486void __init usbhs_init(const struct usbhs_omap_board_data *pdata)487487{488488 struct omap_hwmod *oh[2];489489- struct omap_device *od;489489+ struct platform_device *pdev;490490 int bus_id = -1;491491 int i;492492···522522 return;523523 }524524525525- od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2,525525+ pdev = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2,526526 (void *)&usbhs_data, sizeof(usbhs_data),527527 omap_uhhtll_latency,528528 ARRAY_SIZE(omap_uhhtll_latency), false);529529- if (IS_ERR(od)) {529529+ if (IS_ERR(pdev)) {530530 pr_err("Could not build hwmod devices %s,%s\n",531531 USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME);532532 return;
+2
arch/arm/mach-omap2/voltagedomains3xxx_data.c
···108108 * XXX Will depend on the process, validation, and binning109109 * for the currently-running IC110110 */111111+#ifdef CONFIG_PM_OPP111112 if (cpu_is_omap3630()) {112113 omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data;113114 omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data;···116115 omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data;117116 omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data;118117 }118118+#endif119119120120 if (cpu_is_omap3517() || cpu_is_omap3505())121121 voltdms = voltagedomains_am35xx;
+2
arch/arm/mach-omap2/voltagedomains44xx_data.c
···100100 * XXX Will depend on the process, validation, and binning101101 * for the currently-running IC102102 */103103+#ifdef CONFIG_PM_OPP103104 omap4_voltdm_mpu.volt_data = omap44xx_vdd_mpu_volt_data;104105 omap4_voltdm_iva.volt_data = omap44xx_vdd_iva_volt_data;105106 omap4_voltdm_core.volt_data = omap44xx_vdd_core_volt_data;107107+#endif106108107109 for (i = 0; voltdm = voltagedomains_omap4[i], voltdm; i++)108110 voltdm->sys_clk.name = sys_clk_name;
···168168#define MAXCTRL_SEL_SH 4169169#define MAXCTRL_STR (1u << 7)170170171171+extern int max1111_read_channel(int);171172/*172173 * Read MAX1111 ADC173174 */···177176 /* Ugly, better move this function into another module */178177 if (machine_is_tosa())179178 return 0;180180-181181- extern int max1111_read_channel(int);182179183180 /* max1111 accepts channels from 0-3, however,184181 * it is encoded from 0-7 here in the code.
+2-3
arch/arm/mach-pxa/spitz_pm.c
···172172static unsigned long spitz_charger_wakeup(void)173173{174174 unsigned long ret;175175- ret = (!gpio_get_value(SPITZ_GPIO_KEY_INT)175175+ ret = ((!gpio_get_value(SPITZ_GPIO_KEY_INT)176176 << GPIO_bit(SPITZ_GPIO_KEY_INT))177177- | (!gpio_get_value(SPITZ_GPIO_SYNC)178178- << GPIO_bit(SPITZ_GPIO_SYNC));177177+ | gpio_get_value(SPITZ_GPIO_SYNC));179178 return ret;180179}181180
···4343#include <linux/smsc911x.h>4444#include <linux/sh_intc.h>4545#include <linux/tca6416_keypad.h>4646-#include <linux/usb/r8a66597.h>4746#include <linux/usb/renesas_usbhs.h>4847#include <linux/dma-mapping.h>4948···144145 * 1-2 short | VBUS 5V | Host145146 * open | external VBUS | Function146147 *147147- * *1148148- * CN31 is used as149149- * CONFIG_USB_R8A66597_HCD Host150150- * CONFIG_USB_RENESAS_USBHS Function151151- *152148 * CAUTION153149 *154150 * renesas_usbhs driver can use external interrupt mode···155161 * mackerel can not use external interrupt (IRQ7-PORT167) mode on "USB0",156162 * because Touchscreen is using IRQ7-PORT40.157163 * It is impossible to use IRQ7 demux on this board.158158- *159159- * We can use external interrupt mode USB-Function on "USB1".160160- * USB1 can become Host by r8a66597, and become Function by renesas_usbhs.161161- * But don't select both drivers in same time.162162- * These uses same IRQ number for request_irq(), and aren't supporting163163- * IRQF_SHARED / IORESOURCE_IRQ_SHAREABLE.164164- *165165- * Actually these are old/new version of USB driver.166166- * This mean its register will be broken if it supports shared IRQ,167164 */168165169166/*···190205 *191206 * microSD card sloct192207 *208208+ */209209+210210+/*211211+ * FSI - AK4642212212+ *213213+ * it needs amixer settings for playing214214+ *215215+ * amixer set "Headphone" on216216+ * amixer set "HPOUTL Mixer DACH" on217217+ * amixer set "HPOUTR Mixer DACH" on193218 */194219195220/*···671676 * Use J30 to select between Host and Function. This setting672677 * can however not be detected by software. Hotplug of USBHS1673678 * is provided via IRQ8.679679+ *680680+ * Current USB1 works as "USB Host".681681+ * - set J30 "short"682682+ *683683+ * If you want to use it as "USB gadget",684684+ * - J30 "open"685685+ * - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET686686+ * - add .get_vbus = usbhs_get_vbus in usbhs1_private674687 */675688#define IRQ8 evt2irq(0x0300)676676-677677-/* USBHS1 USB Host support via r8a66597_hcd */678678-static void usb1_host_port_power(int port, int power)679679-{680680- if (!power) /* only power-on is supported for now */681681- return;682682-683683- /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */684684- __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008);685685-}686686-687687-static struct r8a66597_platdata usb1_host_data = {688688- .on_chip = 1,689689- .port_power = usb1_host_port_power,690690-};691691-692692-static struct resource usb1_host_resources[] = {693693- [0] = {694694- .name = "USBHS1",695695- .start = 0xe68b0000,696696- .end = 0xe68b00e6 - 1,697697- .flags = IORESOURCE_MEM,698698- },699699- [1] = {700700- .start = evt2irq(0x1ce0) /* USB1_USB1I0 */,701701- .flags = IORESOURCE_IRQ,702702- },703703-};704704-705705-static struct platform_device usb1_host_device = {706706- .name = "r8a66597_hcd",707707- .id = 1,708708- .dev = {709709- .dma_mask = NULL, /* not use dma */710710- .coherent_dma_mask = 0xffffffff,711711- .platform_data = &usb1_host_data,712712- },713713- .num_resources = ARRAY_SIZE(usb1_host_resources),714714- .resource = usb1_host_resources,715715-};716716-717717-/* USBHS1 USB Function support via renesas_usbhs */718718-719689#define USB_PHY_MODE (1 << 4)720690#define USB_PHY_INT_EN ((1 << 3) | (1 << 2))721691#define USB_PHY_ON (1 << 1)···736776737777static int usbhs1_get_id(struct platform_device *pdev)738778{739739- return USBHS_GADGET;779779+ return USBHS_HOST;740780}741781742782static u32 usbhs1_pipe_cfg[] = {···767807 .hardware_exit = usbhs1_hardware_exit,768808 .get_id = usbhs1_get_id,769809 .phy_reset = usbhs_phy_reset,770770- .get_vbus = usbhs_get_vbus,771810 },772811 .driver_param = {773812 .buswait_bwait = 4,···11431184 },11441185};1145118611461146-static struct sh_mmcif_dma sh_mmcif_dma = {11471147- .chan_priv_rx = {11481148- .slave_id = SHDMA_SLAVE_MMCIF_RX,11491149- },11501150- .chan_priv_tx = {11511151- .slave_id = SHDMA_SLAVE_MMCIF_TX,11521152- },11531153-};11541154-11551187static struct sh_mmcif_plat_data sh_mmcif_plat = {11561188 .sup_pclk = 0,11571189 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,···11501200 MMC_CAP_8_BIT_DATA |11511201 MMC_CAP_NEEDS_POLL,11521202 .get_cd = slot_cn7_get_cd,11531153- .dma = &sh_mmcif_dma,12031203+ .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,12041204+ .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,11541205};1155120611561207static struct platform_device sh_mmcif_device = {···12621311 &nor_flash_device,12631312 &smc911x_device,12641313 &lcdc_device,12651265- &usb1_host_device,12661314 &usbhs1_device,12671315 &usbhs0_device,12681316 &leds_device,···14221472 gpio_request(GPIO_FN_VBUS0_1, NULL);14231473 gpio_pull_down(GPIO_PORT167CR); /* VBUS0_1 pull down */14241474 gpio_request(GPIO_FN_IDIN_1_113, NULL);14251425-14261426- /* USB phy tweak to make the r8a66597_hcd host driver work */14271427- __raw_writew(0x8a0a, 0xe6058130); /* USBCR4 */1428147514291476 /* enable FSI2 port A (ak4643) */14301477 gpio_request(GPIO_FN_FSIAIBT, NULL);
+113
arch/arm/mach-shmobile/clock-sh73a0.c
···365365 dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3),366366};367367368368+/* DSI DIV */369369+static unsigned long dsiphy_recalc(struct clk *clk)370370+{371371+ u32 value;372372+373373+ value = __raw_readl(clk->mapping->base);374374+375375+ /* FIXME */376376+ if (!(value & 0x000B8000))377377+ return clk->parent->rate;378378+379379+ value &= 0x3f;380380+ value += 1;381381+382382+ if ((value < 12) ||383383+ (value > 33)) {384384+ pr_err("DSIPHY has wrong value (%d)", value);385385+ return 0;386386+ }387387+388388+ return clk->parent->rate / value;389389+}390390+391391+static long dsiphy_round_rate(struct clk *clk, unsigned long rate)392392+{393393+ return clk_rate_mult_range_round(clk, 12, 33, rate);394394+}395395+396396+static void dsiphy_disable(struct clk *clk)397397+{398398+ u32 value;399399+400400+ value = __raw_readl(clk->mapping->base);401401+ value &= ~0x000B8000;402402+403403+ __raw_writel(value , clk->mapping->base);404404+}405405+406406+static int dsiphy_enable(struct clk *clk)407407+{408408+ u32 value;409409+ int multi;410410+411411+ value = __raw_readl(clk->mapping->base);412412+ multi = (value & 0x3f) + 1;413413+414414+ if ((multi < 12) || (multi > 33))415415+ return -EIO;416416+417417+ __raw_writel(value | 0x000B8000, clk->mapping->base);418418+419419+ return 0;420420+}421421+422422+static int dsiphy_set_rate(struct clk *clk, unsigned long rate)423423+{424424+ u32 value;425425+ int idx;426426+427427+ idx = rate / clk->parent->rate;428428+ if ((idx < 12) || (idx > 33))429429+ return -EINVAL;430430+431431+ idx += -1;432432+433433+ value = __raw_readl(clk->mapping->base);434434+ value = (value & ~0x3f) + idx;435435+436436+ __raw_writel(value, clk->mapping->base);437437+438438+ return 0;439439+}440440+441441+static struct clk_ops dsiphy_clk_ops = {442442+ .recalc = dsiphy_recalc,443443+ .round_rate = dsiphy_round_rate,444444+ .set_rate = dsiphy_set_rate,445445+ .enable = dsiphy_enable,446446+ .disable = dsiphy_disable,447447+};448448+449449+static struct clk_mapping dsi0phy_clk_mapping = {450450+ .phys = DSI0PHYCR,451451+ .len = 4,452452+};453453+454454+static struct clk_mapping dsi1phy_clk_mapping = {455455+ .phys = DSI1PHYCR,456456+ .len = 4,457457+};458458+459459+static struct clk dsi0phy_clk = {460460+ .ops = &dsiphy_clk_ops,461461+ .parent = &div6_clks[DIV6_DSI0P], /* late install */462462+ .mapping = &dsi0phy_clk_mapping,463463+};464464+465465+static struct clk dsi1phy_clk = {466466+ .ops = &dsiphy_clk_ops,467467+ .parent = &div6_clks[DIV6_DSI1P], /* late install */468468+ .mapping = &dsi1phy_clk_mapping,469469+};470470+471471+static struct clk *late_main_clks[] = {472472+ &dsi0phy_clk,473473+ &dsi1phy_clk,474474+};475475+368476enum { MSTP001,369477 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,370478 MSTP219,···537429 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]),538430 CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]),539431 CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),432432+ CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.0", &dsi0phy_clk),433433+ CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.1", &dsi1phy_clk),540434541435 /* MSTP32 clocks */542436 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */···613503614504 if (!ret)615505 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);506506+507507+ for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)508508+ ret = clk_register(late_main_clks[k]);616509617510 clkdev_add_table(lookups, ARRAY_SIZE(lookups));618511
+3-3
arch/arm/mach-shmobile/include/mach/sh73a0.h
···515515 SHDMA_SLAVE_MMCIF_RX,516516};517517518518-/* PINT interrupts are located at Linux IRQ 768 and up */519519-#define SH73A0_PINT0_IRQ(irq) ((irq) + 768)520520-#define SH73A0_PINT1_IRQ(irq) ((irq) + 800)518518+/* PINT interrupts are located at Linux IRQ 800 and up */519519+#define SH73A0_PINT0_IRQ(irq) ((irq) + 800)520520+#define SH73A0_PINT1_IRQ(irq) ((irq) + 832)521521522522#endif /* __ASM_SH73A0_H__ */
···631631632632config ARM_LPAE633633 bool "Support for the Large Physical Address Extension"634634- depends on MMU && CPU_V7634634+ depends on MMU && CPU_32v7 && !CPU_32v6 && !CPU_32v5 && \635635+ !CPU_32v4 && !CPU_32v3635636 help636637 Say Y if you have an ARMv7 processor supporting the LPAE page637638 table format and you would like to access memory beyond the
+1-1
arch/arm/mm/cache-v7.S
···5555 cmp r1, #2 @ see what cache we have at this level5656 blt skip @ skip if no cache, or just i-cache5757#ifdef CONFIG_PREEMPT5858- save_and_disable_irqs r9 @ make cssr&csidr read atomic5858+ save_and_disable_irqs_notrace r9 @ make cssr&csidr read atomic5959#endif6060 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr6161 isb @ isb to sych the new cssr&csidr
···136136 movel %sp,%d1 /* get thread_info pointer */137137 andl #-THREAD_SIZE,%d1 /* at base of kernel stack */138138 movel %d1,%a0139139- movel %a0@(TINFO_FLAGS),%d1 /* get thread_info->flags */139139+ moveb %a0@(TINFO_FLAGS+3),%d1 /* thread_info->flags (low 8 bits) */140140 jne Lwork_to_do /* still work to do */141141142142Lreturn:···147147 move #0x2000,%sr /* enable intrs again */148148 btst #TIF_NEED_RESCHED,%d1149149 jne reschedule150150-151151- /* GERG: do we need something here for TRACEing?? */152150153151Lsignal_return:154152 subql #4,%sp /* dummy return address */
+7-1
arch/openrisc/include/asm/ptrace.h
···7777 long syscallno; /* Syscall number (used by strace) */7878 long dummy; /* Cheap alignment fix */7979};8080-#endif /* __ASSEMBLY__ */81808281/* TODO: Rename this to REDZONE because that's what it is */8382#define STACK_FRAME_OVERHEAD 128 /* size of minimum stack frame */···8586#define user_mode(regs) (((regs)->sr & SPR_SR_SM) == 0)8687#define user_stack_pointer(regs) ((unsigned long)(regs)->sp)8788#define profile_pc(regs) instruction_pointer(regs)8989+9090+static inline long regs_return_value(struct pt_regs *regs)9191+{9292+ return regs->gpr[11];9393+}9494+9595+#endif /* __ASSEMBLY__ */88968997/*9098 * Offsets used by 'ptrace' system call interface.
···227227config SYSVIPC_COMPAT228228 def_bool y if COMPAT && SYSVIPC229229230230+config KEYS_COMPAT231231+ def_bool y if COMPAT && KEYS232232+230233config AUDIT_ARCH231234 def_bool y232235
···33 *44 * This file is released under the GPLv255 */66+#ifndef __ASM_SH_DEVICE_H77+#define __ASM_SH_DEVICE_H6877-struct dev_archdata {88-};99+#include <asm-generic/device.h>9101011struct platform_device;1112/* allocate contiguous memory chunk and fill in struct resource */···15141615void plat_early_device_setup(void);17161818-struct pdev_archdata {1919-};1717+#endif /* __ASM_SH_DEVICE_H */
···2727 * Presently all SH-X3 SMP cores are multi-cores, so just keep it2828 * simple until we have a method for determining topology..2929 */3030- return cpu_possible_map;3030+ return *cpu_possible_mask;3131}32323333const struct cpumask *cpu_coregroup_mask(unsigned int cpu)
+2
arch/sh/mm/cache-sh2a.c
···2323#define MAX_OCACHE_PAGES 322424#define MAX_ICACHE_PAGES 3225252626+#ifdef CONFIG_CACHE_WRITEBACK2627static void sh2a_flush_oc_line(unsigned long v, int way)2728{2829 unsigned long addr = (v & 0x000007f0) | (way << 11);···3534 __raw_writel(data, CACHE_OC_ADDRESS_ARRAY | addr);3635 }3736}3737+#endif38383939static void sh2a_invalidate_line(unsigned long cache_addr, unsigned long v)4040{
+38-15
arch/x86/include/asm/i387.h
···2929extern void fpu_init(void);3030extern void mxcsr_feature_mask_init(void);3131extern int init_fpu(struct task_struct *child);3232-extern void __math_state_restore(struct task_struct *);3332extern void math_state_restore(void);3433extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);3434+3535+DECLARE_PER_CPU(struct task_struct *, fpu_owner_task);35363637extern user_regset_active_fn fpregs_active, xfpregs_active;3738extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get,···270269271270static inline int restore_fpu_checking(struct task_struct *tsk)272271{272272+ /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception273273+ is pending. Clear the x87 state here by setting it to fixed274274+ values. "m" is a random variable that should be in L1 */275275+ alternative_input(276276+ ASM_NOP8 ASM_NOP2,277277+ "emms\n\t" /* clear stack tags */278278+ "fildl %P[addr]", /* set F?P to defined value */279279+ X86_FEATURE_FXSAVE_LEAK,280280+ [addr] "m" (tsk->thread.fpu.has_fpu));281281+273282 return fpu_restore_checking(&tsk->thread.fpu);274283}275284···290279 */291280static inline int __thread_has_fpu(struct task_struct *tsk)292281{293293- return tsk->thread.has_fpu;282282+ return tsk->thread.fpu.has_fpu;294283}295284296285/* Must be paired with an 'stts' after! */297286static inline void __thread_clear_has_fpu(struct task_struct *tsk)298287{299299- tsk->thread.has_fpu = 0;288288+ tsk->thread.fpu.has_fpu = 0;289289+ percpu_write(fpu_owner_task, NULL);300290}301291302292/* Must be paired with a 'clts' before! */303293static inline void __thread_set_has_fpu(struct task_struct *tsk)304294{305305- tsk->thread.has_fpu = 1;295295+ tsk->thread.fpu.has_fpu = 1;296296+ percpu_write(fpu_owner_task, tsk);306297}307298308299/*···349336 * We don't do that yet, so "fpu_lazy_restore()" always returns350337 * false, but some day..351338 */352352-#define fpu_lazy_restore(tsk) (0)353353-#define fpu_lazy_state_intact(tsk) do { } while (0)339339+static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu)340340+{341341+ return new == percpu_read_stable(fpu_owner_task) &&342342+ cpu == new->thread.fpu.last_cpu;343343+}354344355355-static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct task_struct *new)345345+static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct task_struct *new, int cpu)356346{357347 fpu_switch_t fpu;358348359349 fpu.preload = tsk_used_math(new) && new->fpu_counter > 5;360350 if (__thread_has_fpu(old)) {361361- if (__save_init_fpu(old))362362- fpu_lazy_state_intact(old);363363- __thread_clear_has_fpu(old);364364- old->fpu_counter++;351351+ if (!__save_init_fpu(old))352352+ cpu = ~0;353353+ old->thread.fpu.last_cpu = cpu;354354+ old->thread.fpu.has_fpu = 0; /* But leave fpu_owner_task! */365355366356 /* Don't change CR0.TS if we just switch! */367357 if (fpu.preload) {358358+ new->fpu_counter++;368359 __thread_set_has_fpu(new);369360 prefetch(new->thread.fpu.state);370361 } else371362 stts();372363 } else {373364 old->fpu_counter = 0;365365+ old->thread.fpu.last_cpu = ~0;374366 if (fpu.preload) {375375- if (fpu_lazy_restore(new))367367+ new->fpu_counter++;368368+ if (fpu_lazy_restore(new, cpu))376369 fpu.preload = 0;377370 else378371 prefetch(new->thread.fpu.state);···396377 */397378static inline void switch_fpu_finish(struct task_struct *new, fpu_switch_t fpu)398379{399399- if (fpu.preload)400400- __math_state_restore(new);380380+ if (fpu.preload) {381381+ if (unlikely(restore_fpu_checking(new)))382382+ __thread_fpu_end(new);383383+ }401384}402385403386/*···472451 __save_init_fpu(me);473452 __thread_clear_has_fpu(me);474453 /* We do 'stts()' in kernel_fpu_end() */475475- } else454454+ } else {455455+ percpu_write(fpu_owner_task, NULL);476456 clts();457457+ }477458}478459479460static inline void kernel_fpu_end(void)
···374374};375375376376struct fpu {377377+ unsigned int last_cpu;378378+ unsigned int has_fpu;377379 union thread_xstate *state;378380};379381···456454 unsigned long trap_no;457455 unsigned long error_code;458456 /* floating point and extended processor state */459459- unsigned long has_fpu;460457 struct fpu fpu;461458#ifdef CONFIG_X86_32462459 /* Virtual 86 mode info */
+5
arch/x86/kernel/cpu/common.c
···1044104410451045DEFINE_PER_CPU(unsigned int, irq_count) = -1;1046104610471047+DEFINE_PER_CPU(struct task_struct *, fpu_owner_task);10481048+EXPORT_PER_CPU_SYMBOL(fpu_owner_task);10491049+10471050/*10481051 * Special IST stacks which the CPU switches to when it calls10491052 * an IST-marked descriptor entry. Up to 7 stacks (hardware···1114111111151112DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task;11161113EXPORT_PER_CPU_SYMBOL(current_task);11141114+DEFINE_PER_CPU(struct task_struct *, fpu_owner_task);11151115+EXPORT_PER_CPU_SYMBOL(fpu_owner_task);1117111611181117#ifdef CONFIG_CC_STACKPROTECTOR11191118DEFINE_PER_CPU_ALIGNED(struct stack_canary, stack_canary);
+36-8
arch/x86/kernel/cpu/intel_cacheinfo.c
···326326 l3->indices = (max(max3(sc0, sc1, sc2), sc3) << 10) - 1;327327}328328329329-static void __cpuinit amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf,330330- int index)329329+static void __cpuinit amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index)331330{332331 int node;333332···724725#define CPUID4_INFO_IDX(x, y) (&((per_cpu(ici_cpuid4_info, x))[y]))725726726727#ifdef CONFIG_SMP727727-static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)728728+729729+static int __cpuinit cache_shared_amd_cpu_map_setup(unsigned int cpu, int index)728730{729729- struct _cpuid4_info *this_leaf, *sibling_leaf;730730- unsigned long num_threads_sharing;731731- int index_msb, i, sibling;731731+ struct _cpuid4_info *this_leaf;732732+ int ret, i, sibling;732733 struct cpuinfo_x86 *c = &cpu_data(cpu);733734734734- if ((index == 3) && (c->x86_vendor == X86_VENDOR_AMD)) {735735+ ret = 0;736736+ if (index == 3) {737737+ ret = 1;735738 for_each_cpu(i, cpu_llc_shared_mask(cpu)) {736739 if (!per_cpu(ici_cpuid4_info, i))737740 continue;···744743 set_bit(sibling, this_leaf->shared_cpu_map);745744 }746745 }747747- return;746746+ } else if ((c->x86 == 0x15) && ((index == 1) || (index == 2))) {747747+ ret = 1;748748+ for_each_cpu(i, cpu_sibling_mask(cpu)) {749749+ if (!per_cpu(ici_cpuid4_info, i))750750+ continue;751751+ this_leaf = CPUID4_INFO_IDX(i, index);752752+ for_each_cpu(sibling, cpu_sibling_mask(cpu)) {753753+ if (!cpu_online(sibling))754754+ continue;755755+ set_bit(sibling, this_leaf->shared_cpu_map);756756+ }757757+ }748758 }759759+760760+ return ret;761761+}762762+763763+static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)764764+{765765+ struct _cpuid4_info *this_leaf, *sibling_leaf;766766+ unsigned long num_threads_sharing;767767+ int index_msb, i;768768+ struct cpuinfo_x86 *c = &cpu_data(cpu);769769+770770+ if (c->x86_vendor == X86_VENDOR_AMD) {771771+ if (cache_shared_amd_cpu_map_setup(cpu, index))772772+ return;773773+ }774774+749775 this_leaf = CPUID4_INFO_IDX(cpu, index);750776 num_threads_sharing = 1 + this_leaf->base.eax.split.num_threads_sharing;751777
+2
arch/x86/kernel/cpu/mcheck/mce_amd.c
···528528529529 sprintf(name, "threshold_bank%i", bank);530530531531+#ifdef CONFIG_SMP531532 if (cpu_data(cpu).cpu_core_id && shared_bank[bank]) { /* symlink */532533 i = cpumask_first(cpu_llc_shared_mask(cpu));533534···554553555554 goto out;556555 }556556+#endif557557558558 b = kzalloc(sizeof(struct threshold_bank), GFP_KERNEL);559559 if (!b) {
+6-2
arch/x86/kernel/cpu/perf_event.h
···147147 /*148148 * AMD specific bits149149 */150150- struct amd_nb *amd_nb;150150+ struct amd_nb *amd_nb;151151+ /* Inverted mask of bits to clear in the perf_ctr ctrl registers */152152+ u64 perf_ctr_virt_mask;151153152154 void *kfree_on_online;153155};···419417static inline void __x86_pmu_enable_event(struct hw_perf_event *hwc,420418 u64 enable_mask)421419{420420+ u64 disable_mask = __this_cpu_read(cpu_hw_events.perf_ctr_virt_mask);421421+422422 if (hwc->extra_reg.reg)423423 wrmsrl(hwc->extra_reg.reg, hwc->extra_reg.config);424424- wrmsrl(hwc->config_base, hwc->config | enable_mask);424424+ wrmsrl(hwc->config_base, (hwc->config | enable_mask) & ~disable_mask);425425}426426427427void x86_pmu_enable_all(int added);
+35-2
arch/x86/kernel/cpu/perf_event_amd.c
···11#include <linux/perf_event.h>22+#include <linux/export.h>23#include <linux/types.h>34#include <linux/init.h>45#include <linux/slab.h>···358357 struct amd_nb *nb;359358 int i, nb_id;360359361361- if (boot_cpu_data.x86_max_cores < 2)360360+ cpuc->perf_ctr_virt_mask = AMD_PERFMON_EVENTSEL_HOSTONLY;361361+362362+ if (boot_cpu_data.x86_max_cores < 2 || boot_cpu_data.x86 == 0x15)362363 return;363364364365 nb_id = amd_get_nb_id(cpu);···590587 .put_event_constraints = amd_put_event_constraints,591588592589 .cpu_prepare = amd_pmu_cpu_prepare,593593- .cpu_starting = amd_pmu_cpu_starting,594590 .cpu_dead = amd_pmu_cpu_dead,595591#endif592592+ .cpu_starting = amd_pmu_cpu_starting,596593};597594598595__init int amd_pmu_init(void)···624621625622 return 0;626623}624624+625625+void amd_pmu_enable_virt(void)626626+{627627+ struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);628628+629629+ cpuc->perf_ctr_virt_mask = 0;630630+631631+ /* Reload all events */632632+ x86_pmu_disable_all();633633+ x86_pmu_enable_all(0);634634+}635635+EXPORT_SYMBOL_GPL(amd_pmu_enable_virt);636636+637637+void amd_pmu_disable_virt(void)638638+{639639+ struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);640640+641641+ /*642642+ * We only mask out the Host-only bit so that host-only counting works643643+ * when SVM is disabled. If someone sets up a guest-only counter when644644+ * SVM is disabled the Guest-only bits still gets set and the counter645645+ * will not count anything.646646+ */647647+ cpuc->perf_ctr_virt_mask = AMD_PERFMON_EVENTSEL_HOSTONLY;648648+649649+ /* Reload all events */650650+ x86_pmu_disable_all();651651+ x86_pmu_enable_all(0);652652+}653653+EXPORT_SYMBOL_GPL(amd_pmu_disable_virt);
+8-1
arch/x86/kernel/entry_64.S
···15321532 pushq_cfi %rdx1533153315341534 /*15351535+ * If %cs was not the kernel segment, then the NMI triggered in user15361536+ * space, which means it is definitely not nested.15371537+ */15381538+ cmpl $__KERNEL_CS, 16(%rsp)15391539+ jne first_nmi15401540+15411541+ /*15351542 * Check the special variable on the stack to see if NMIs are15361543 * executing.15371544 */15381538- cmp $1, -8(%rsp)15451545+ cmpl $1, -8(%rsp)15391546 je nested_nmi1540154715411548 /*
-1
arch/x86/kernel/microcode_amd.c
···360360static enum ucode_state361361request_microcode_user(int cpu, const void __user *buf, size_t size)362362{363363- pr_info("AMD microcode update via /dev/cpu/microcode not supported\n");364363 return UCODE_ERROR;365364}366365
···571571}572572573573/*574574- * This gets called with the process already owning the575575- * FPU state, and with CR0.TS cleared. It just needs to576576- * restore the FPU register state.577577- */578578-void __math_state_restore(struct task_struct *tsk)579579-{580580- /* We need a safe address that is cheap to find and that is already581581- in L1. We've just brought in "tsk->thread.has_fpu", so use that */582582-#define safe_address (tsk->thread.has_fpu)583583-584584- /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception585585- is pending. Clear the x87 state here by setting it to fixed586586- values. safe_address is a random variable that should be in L1 */587587- alternative_input(588588- ASM_NOP8 ASM_NOP2,589589- "emms\n\t" /* clear stack tags */590590- "fildl %P[addr]", /* set F?P to defined value */591591- X86_FEATURE_FXSAVE_LEAK,592592- [addr] "m" (safe_address));593593-594594- /*595595- * Paranoid restore. send a SIGSEGV if we fail to restore the state.596596- */597597- if (unlikely(restore_fpu_checking(tsk))) {598598- __thread_fpu_end(tsk);599599- force_sig(SIGSEGV, tsk);600600- return;601601- }602602-}603603-604604-/*605574 * 'math_state_restore()' saves the current math information in the606575 * old math state array, and gets the new ones from the current task607576 *···600631 }601632602633 __thread_fpu_begin(tsk);603603- __math_state_restore(tsk);634634+ /*635635+ * Paranoid restore. send a SIGSEGV if we fail to restore the state.636636+ */637637+ if (unlikely(restore_fpu_checking(tsk))) {638638+ __thread_fpu_end(tsk);639639+ force_sig(SIGSEGV, tsk);640640+ return;641641+ }604642605643 tsk->fpu_counter++;606644}
···1141114111421142 /* Prevent unwanted bits from being set in PTEs. */11431143 __supported_pte_mask &= ~_PAGE_GLOBAL;11441144+#if 011441145 if (!xen_initial_domain())11461146+#endif11451147 __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);1146114811471149 __supported_pte_mask |= _PAGE_IOMAP;···1206120412071205 pgd = (pgd_t *)xen_start_info->pt_base;1208120612091209- if (!xen_initial_domain())12101210- __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);12111211-12121212- __supported_pte_mask |= _PAGE_IOMAP;12131207 /* Don't do the full vcpu_info placement stuff until we have a12141208 possible map and a non-dummy shared_info. */12151209 per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
+4-4
arch/x86/xen/mmu.c
···415415static pteval_t xen_pte_val(pte_t pte)416416{417417 pteval_t pteval = pte.pte;418418-418418+#if 0419419 /* If this is a WC pte, convert back from Xen WC to Linux WC */420420 if ((pteval & (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT)) == _PAGE_PAT) {421421 WARN_ON(!pat_enabled);422422 pteval = (pteval & ~_PAGE_PAT) | _PAGE_PWT;423423 }424424-424424+#endif425425 if (xen_initial_domain() && (pteval & _PAGE_IOMAP))426426 return pteval;427427···463463static pte_t xen_make_pte(pteval_t pte)464464{465465 phys_addr_t addr = (pte & PTE_PFN_MASK);466466-466466+#if 0467467 /* If Linux is trying to set a WC pte, then map to the Xen WC.468468 * If _PAGE_PAT is set, then it probably means it is really469469 * _PAGE_PSE, so avoid fiddling with the PAT mapping and hope···476476 if ((pte & (_PAGE_PCD | _PAGE_PWT)) == _PAGE_PWT)477477 pte = (pte & ~(_PAGE_PCD | _PAGE_PWT)) | _PAGE_PAT;478478 }479479-479479+#endif480480 /*481481 * Unprivileged domains are allowed to do IOMAPpings for482482 * PCI passthrough, but not map ISA space. The ISA
+4-7
block/partitions/ldm.c
···22 * ldm - Support for Windows Logical Disk Manager (Dynamic Disks)33 *44 * Copyright (C) 2001,2002 Richard Russon <ldm@flatcap.org>55- * Copyright (c) 2001-2007 Anton Altaparmakov55+ * Copyright (c) 2001-2012 Anton Altaparmakov66 * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com>77 *88 * Documentation is available at http://www.linux-ntfs.org/doku.php?id=downloads ···13411341 ldm_error("REC value (%d) exceeds NUM value (%d)", rec, f->num);13421342 return false;13431343 }13441344-13451344 if (f->map & (1 << rec)) {13461345 ldm_error ("Duplicate VBLK, part %d.", rec);13471346 f->map &= 0x7F; /* Mark the group as broken */13481347 return false;13491348 }13501350-13511349 f->map |= (1 << rec);13521352-13501350+ if (!rec)13511351+ memcpy(f->data, data, VBLK_SIZE_HEAD);13531352 data += VBLK_SIZE_HEAD;13541353 size -= VBLK_SIZE_HEAD;13551355-13561356- memcpy (f->data+rec*(size-VBLK_SIZE_HEAD)+VBLK_SIZE_HEAD, data, size);13571357-13541354+ memcpy(f->data + VBLK_SIZE_HEAD + rec * size, data, size);13581355 return true;13591356}13601357
···1122config CPU_IDLE33 bool "CPU idle PM support"44- default ACPI44+ default y if ACPI || PPC_PSERIES55 help66 CPU idle is a generic framework for supporting software-controlled77 idle processor power management. It includes modular cross-platform
···193193 return err;194194 }195195196196+ /* setup possible_clones. */197197+ exynos_drm_encoder_setup(drm_dev);198198+196199 /*197200 * if any specific driver such as fimd or hdmi driver called198201 * exynos_drm_subdrv_register() later than drm_load(),
+3-3
drivers/gpu/drm/exynos/exynos_drm_crtc.c
···307307 */308308 event->pipe = exynos_crtc->pipe;309309310310- list_add_tail(&event->base.link,311311- &dev_priv->pageflip_event_list);312312-313310 ret = drm_vblank_get(dev, exynos_crtc->pipe);314311 if (ret) {315312 DRM_DEBUG("failed to acquire vblank counter\n");···314317315318 goto out;316319 }320320+321321+ list_add_tail(&event->base.link,322322+ &dev_priv->pageflip_event_list);317323318324 crtc->fb = fb;319325 ret = exynos_drm_crtc_update(crtc);
+18-8
drivers/gpu/drm/exynos/exynos_drm_drv.c
···33333434#include "exynos_drm_drv.h"3535#include "exynos_drm_crtc.h"3636+#include "exynos_drm_encoder.h"3637#include "exynos_drm_fbdev.h"3738#include "exynos_drm_fb.h"3839#include "exynos_drm_gem.h"···10099 if (ret)101100 goto err_vblank;102101102102+ /* setup possible_clones. */103103+ exynos_drm_encoder_setup(dev);104104+103105 /*104106 * create and configure fb helper and also exynos specific105107 * fbdev object.···145141}146142147143static void exynos_drm_preclose(struct drm_device *dev,148148- struct drm_file *file_priv)144144+ struct drm_file *file)149145{150150- struct exynos_drm_private *dev_priv = dev->dev_private;146146+ DRM_DEBUG_DRIVER("%s\n", __FILE__);151147152152- /*153153- * drm framework frees all events at release time,154154- * so private event list should be cleared.155155- */156156- if (!list_empty(&dev_priv->pageflip_event_list))157157- INIT_LIST_HEAD(&dev_priv->pageflip_event_list);148148+}149149+150150+static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)151151+{152152+ DRM_DEBUG_DRIVER("%s\n", __FILE__);153153+154154+ if (!file->driver_priv)155155+ return;156156+157157+ kfree(file->driver_priv);158158+ file->driver_priv = NULL;158159}159160160161static void exynos_drm_lastclose(struct drm_device *dev)···204195 .unload = exynos_drm_unload,205196 .preclose = exynos_drm_preclose,206197 .lastclose = exynos_drm_lastclose,198198+ .postclose = exynos_drm_postclose,207199 .get_vblank_counter = drm_vblank_count,208200 .enable_vblank = exynos_drm_crtc_enable_vblank,209201 .disable_vblank = exynos_drm_crtc_disable_vblank,
+2-2
drivers/gpu/drm/exynos/exynos_drm_drv.h
···136136 * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI.137137 * @is_connected: check for that display is connected or not.138138 * @get_edid: get edid modes from display driver.139139- * @get_timing: get timing object from display driver.139139+ * @get_panel: get panel object from display driver.140140 * @check_timing: check if timing is valid or not.141141 * @power_on: display device on or off.142142 */···145145 bool (*is_connected)(struct device *dev);146146 int (*get_edid)(struct device *dev, struct drm_connector *connector,147147 u8 *edid, int len);148148- void *(*get_timing)(struct device *dev);148148+ void *(*get_panel)(struct device *dev);149149 int (*check_timing)(struct device *dev, void *timing);150150 int (*power_on)(struct device *dev, int mode);151151};
···4680468046814681 crtc = intel_get_crtc_for_plane(dev, plane);46824682 clock = crtc->mode.clock;46834683+ if (!clock) {46844684+ *sprite_wm = 0;46854685+ return false;46864686+ }4683468746844688 line_time_us = (sprite_width * 1000) / clock;46894689+ if (!line_time_us) {46904690+ *sprite_wm = 0;46914691+ return false;46924692+ }46934693+46854694 line_count = (latency_ns / line_time_us + 1000) / 1000;46864695 line_size = sprite_width * pixel_size;46874696···61846175 int i;6185617661866177 /* The clocks have to be on to load the palette. */61876187- if (!crtc->enabled)61786178+ if (!crtc->enabled || !intel_crtc->active)61886179 return;6189618061906181 /* use legacy palette for Ironlake */···65706561 mode_cmd.height = mode->vdisplay;65716562 mode_cmd.pitches[0] = intel_framebuffer_pitch_for_width(mode_cmd.width,65726563 bpp);65736573- mode_cmd.pixel_format = 0;65646564+ mode_cmd.pixel_format = drm_mode_legacy_fb_format(bpp, depth);6574656565756566 return intel_framebuffer_create(dev, &mode_cmd, obj);65766567}···81938184 I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */8194818581958186 if (intel_enable_rc6(dev_priv->dev))81968196- rc6_mask = GEN6_RC_CTL_RC6p_ENABLE |81978197- GEN6_RC_CTL_RC6_ENABLE;81878187+ rc6_mask = GEN6_RC_CTL_RC6_ENABLE |81888188+ ((IS_GEN7(dev_priv->dev)) ? GEN6_RC_CTL_RC6p_ENABLE : 0);8198818981998190 I915_WRITE(GEN6_RC_CONTROL,82008191 rc6_mask |···84728463 I915_WRITE(WM2_LP_ILK, 0);84738464 I915_WRITE(WM1_LP_ILK, 0);8474846584668466+ /* According to the spec, bit 13 (RCZUNIT) must be set on IVB.84678467+ * This implements the WaDisableRCZUnitClockGating workaround.84688468+ */84698469+ I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE);84708470+84758471 I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE);8476847284778473 I915_WRITE(IVB_CHICKEN3,84788474 CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE |84798475 CHICKEN3_DGMG_DONE_FIX_DISABLE);84768476+84778477+ /* Apply the WaDisableRHWOOptimizationForRenderHang workaround. */84788478+ I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1,84798479+ GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC);84808480+84818481+ /* WaApplyL3ControlAndL3ChickenMode requires those two on Ivy Bridge */84828482+ I915_WRITE(GEN7_L3CNTLREG1,84838483+ GEN7_WA_FOR_GEN7_L3_CONTROL);84848484+ I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,84858485+ GEN7_WA_L3_CHICKEN_MODE);84868486+84878487+ /* This is required by WaCatErrorRejectionIssue */84888488+ I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,84898489+ I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |84908490+ GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB);8480849184818492 for_each_pipe(pipe) {84828493 I915_WRITE(DSPCNTR(pipe),
+1-13
drivers/gpu/drm/i915/intel_ringbuffer.c
···301301302302 I915_WRITE_CTL(ring,303303 ((ring->size - PAGE_SIZE) & RING_NR_PAGES)304304- | RING_REPORT_64K | RING_VALID);304304+ | RING_VALID);305305306306 /* If the head is still not zero, the ring is dead */307307 if ((I915_READ_CTL(ring) & RING_VALID) == 0 ||···11321132 struct drm_device *dev = ring->dev;11331133 struct drm_i915_private *dev_priv = dev->dev_private;11341134 unsigned long end;11351135- u32 head;11361136-11371137- /* If the reported head position has wrapped or hasn't advanced,11381138- * fallback to the slow and accurate path.11391139- */11401140- head = intel_read_status_page(ring, 4);11411141- if (head > ring->head) {11421142- ring->head = head;11431143- ring->space = ring_space(ring);11441144- if (ring->space >= n)11451145- return 0;11461146- }1147113511481136 trace_i915_ring_wait_begin(ring);11491137 if (drm_core_check_feature(dev, DRIVER_GEM))
···3928392839293929int r100_resume(struct radeon_device *rdev)39303930{39313931+ int r;39323932+39313933 /* Make sur GART are not working */39323934 if (rdev->flags & RADEON_IS_PCI)39333935 r100_pci_gart_disable(rdev);···39493947 radeon_surface_init(rdev);3950394839513949 rdev->accel_working = true;39523952- return r100_startup(rdev);39503950+ r = r100_startup(rdev);39513951+ if (r) {39523952+ rdev->accel_working = false;39533953+ }39543954+ return r;39533955}3954395639553957int r100_suspend(struct radeon_device *rdev)
+7-1
drivers/gpu/drm/radeon/r300.c
···1431143114321432int r300_resume(struct radeon_device *rdev)14331433{14341434+ int r;14351435+14341436 /* Make sur GART are not working */14351437 if (rdev->flags & RADEON_IS_PCIE)14361438 rv370_pcie_gart_disable(rdev);···14541452 radeon_surface_init(rdev);1455145314561454 rdev->accel_working = true;14571457- return r300_startup(rdev);14551455+ r = r300_startup(rdev);14561456+ if (r) {14571457+ rdev->accel_working = false;14581458+ }14591459+ return r;14581460}1459146114601462int r300_suspend(struct radeon_device *rdev)
+7-1
drivers/gpu/drm/radeon/r420.c
···291291292292int r420_resume(struct radeon_device *rdev)293293{294294+ int r;295295+294296 /* Make sur GART are not working */295297 if (rdev->flags & RADEON_IS_PCIE)296298 rv370_pcie_gart_disable(rdev);···318316 radeon_surface_init(rdev);319317320318 rdev->accel_working = true;321321- return r420_startup(rdev);319319+ r = r420_startup(rdev);320320+ if (r) {321321+ rdev->accel_working = false;322322+ }323323+ return r;322324}323325324326int r420_suspend(struct radeon_device *rdev)
+7-1
drivers/gpu/drm/radeon/r520.c
···218218219219int r520_resume(struct radeon_device *rdev)220220{221221+ int r;222222+221223 /* Make sur GART are not working */222224 if (rdev->flags & RADEON_IS_PCIE)223225 rv370_pcie_gart_disable(rdev);···239237 radeon_surface_init(rdev);240238241239 rdev->accel_working = true;242242- return r520_startup(rdev);240240+ r = r520_startup(rdev);241241+ if (r) {242242+ rdev->accel_working = false;243243+ }244244+ return r;243245}244246245247int r520_init(struct radeon_device *rdev)
···30203020 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);30213021 uint32_t bios_2_scratch;3022302230233023+ if (ASIC_IS_DCE4(rdev))30243024+ return;30253025+30233026 if (rdev->family >= CHIP_R600)30243027 bios_2_scratch = RREG32(R600_BIOS_2_SCRATCH);30253028 else
+17-8
drivers/gpu/drm/radeon/radeon_connectors.c
···11171117 (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)) {11181118 struct drm_display_mode *mode;1119111911201120- if (!radeon_dig_connector->edp_on)11211121- atombios_set_edp_panel_power(connector,11221122- ATOM_TRANSMITTER_ACTION_POWER_ON);11231123- ret = radeon_ddc_get_modes(radeon_connector);11241124- if (!radeon_dig_connector->edp_on)11251125- atombios_set_edp_panel_power(connector,11261126- ATOM_TRANSMITTER_ACTION_POWER_OFF);11201120+ if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {11211121+ if (!radeon_dig_connector->edp_on)11221122+ atombios_set_edp_panel_power(connector,11231123+ ATOM_TRANSMITTER_ACTION_POWER_ON);11241124+ ret = radeon_ddc_get_modes(radeon_connector);11251125+ if (!radeon_dig_connector->edp_on)11261126+ atombios_set_edp_panel_power(connector,11271127+ ATOM_TRANSMITTER_ACTION_POWER_OFF);11281128+ } else {11291129+ /* need to setup ddc on the bridge */11301130+ if (radeon_connector_encoder_get_dp_bridge_encoder_id(connector) !=11311131+ ENCODER_OBJECT_ID_NONE) {11321132+ if (encoder)11331133+ radeon_atom_ext_encoder_setup_ddc(encoder);11341134+ }11351135+ ret = radeon_ddc_get_modes(radeon_connector);11361136+ }1127113711281138 if (ret > 0) {11291139 if (encoder) {···11441134 return ret;11451135 }1146113611471147- encoder = radeon_best_single_encoder(connector);11481137 if (!encoder)11491138 return 0;11501139
···442442443443int rs400_resume(struct radeon_device *rdev)444444{445445+ int r;446446+445447 /* Make sur GART are not working */446448 rs400_gart_disable(rdev);447449 /* Resume clock before doing reset */···464462 radeon_surface_init(rdev);465463466464 rdev->accel_working = true;467467- return rs400_startup(rdev);465465+ r = rs400_startup(rdev);466466+ if (r) {467467+ rdev->accel_working = false;468468+ }469469+ return r;468470}469471470472int rs400_suspend(struct radeon_device *rdev)
+7-1
drivers/gpu/drm/radeon/rs600.c
···876876877877int rs600_resume(struct radeon_device *rdev)878878{879879+ int r;880880+879881 /* Make sur GART are not working */880882 rs600_gart_disable(rdev);881883 /* Resume clock before doing reset */···896894 radeon_surface_init(rdev);897895898896 rdev->accel_working = true;899899- return rs600_startup(rdev);897897+ r = rs600_startup(rdev);898898+ if (r) {899899+ rdev->accel_working = false;900900+ }901901+ return r;900902}901903902904int rs600_suspend(struct radeon_device *rdev)
+7-1
drivers/gpu/drm/radeon/rs690.c
···659659660660int rs690_resume(struct radeon_device *rdev)661661{662662+ int r;663663+662664 /* Make sur GART are not working */663665 rs400_gart_disable(rdev);664666 /* Resume clock before doing reset */···679677 radeon_surface_init(rdev);680678681679 rdev->accel_working = true;682682- return rs690_startup(rdev);680680+ r = rs690_startup(rdev);681681+ if (r) {682682+ rdev->accel_working = false;683683+ }684684+ return r;683685}684686685687int rs690_suspend(struct radeon_device *rdev)
+7-1
drivers/gpu/drm/radeon/rv515.c
···424424425425int rv515_resume(struct radeon_device *rdev)426426{427427+ int r;428428+427429 /* Make sur GART are not working */428430 if (rdev->flags & RADEON_IS_PCIE)429431 rv370_pcie_gart_disable(rdev);···445443 radeon_surface_init(rdev);446444447445 rdev->accel_working = true;448448- return rv515_startup(rdev);446446+ r = rv515_startup(rdev);447447+ if (r) {448448+ rdev->accel_working = false;449449+ }450450+ return r;449451}450452451453int rv515_suspend(struct radeon_device *rdev)
···72727373static const int rpm_ranges[] = { 2000, 4000, 8000, 16000 };74747575-#define FAN_FROM_REG(val, div, rpm_range) ((val) == 0 ? -1 : \7676- (val) == 255 ? 0 : (rpm_ranges[rpm_range] * 30) / ((div + 1) * (val)))7575+#define FAN_FROM_REG(val, rpm_range) ((val) == 0 || (val) == 255 ? \7676+ 0 : (rpm_ranges[rpm_range] * 30) / (val))7777#define TEMP_LIMIT_TO_REG(val) SENSORS_LIMIT((val) / 1000, 0, 255)78787979/*···333333 return PTR_ERR(data);334334335335 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[attr->index],336336- data->ppr, data->rpm_range));336336+ data->rpm_range));337337}338338339339static ssize_t show_alarm(struct device *dev,···429429 struct max6639_data *data = i2c_get_clientdata(client);430430 struct max6639_platform_data *max6639_info =431431 client->dev.platform_data;432432- int i = 0;432432+ int i;433433 int rpm_range = 1; /* default: 4000 RPM */434434- int err = 0;434434+ int err;435435436436 /* Reset chip to default values, see below for GCONFIG setup */437437 err = i2c_smbus_write_byte_data(client, MAX6639_REG_GCONFIG,···446446 else447447 data->ppr = 2;448448 data->ppr -= 1;449449- err = i2c_smbus_write_byte_data(client,450450- MAX6639_REG_FAN_PPR(i),451451- data->ppr << 5);452452- if (err)453453- goto exit;454449455450 if (max6639_info)456451 rpm_range = rpm_range_to_reg(max6639_info->rpm_range);457452 data->rpm_range = rpm_range;458453459454 for (i = 0; i < 2; i++) {455455+456456+ /* Set Fan pulse per revolution */457457+ err = i2c_smbus_write_byte_data(client,458458+ MAX6639_REG_FAN_PPR(i),459459+ data->ppr << 6);460460+ if (err)461461+ goto exit;460462461463 /* Fans config PWM, RPM */462464 err = i2c_smbus_write_byte_data(client,
+1-1
drivers/hwmon/pmbus/max34440.c
···8282 case PMBUS_VIRT_RESET_TEMP_HISTORY:8383 ret = pmbus_write_word_data(client, page,8484 MAX34440_MFR_TEMPERATURE_PEAK,8585- 0xffff);8585+ 0x8000);8686 break;8787 default:8888 ret = -ENODATA;
···1223122312241224 return platform_driver_register(&omap_iommu_driver);12251225}12261226-module_init(omap_iommu_init);12261226+/* must be ready before omap3isp is probed */12271227+subsys_initcall(omap_iommu_init);1227122812281229static void __exit omap_iommu_exit(void)12291230{
+2-2
drivers/media/radio/wl128x/Kconfig
···44menu "Texas Instruments WL128x FM driver (ST based)"55config RADIO_WL128X66 tristate "Texas Instruments WL128x FM Radio"77- depends on VIDEO_V4L2 && RFKILL88- select TI_ST if NET && GPIOLIB77+ depends on VIDEO_V4L2 && RFKILL && GPIOLIB88+ select TI_ST if NET99 help1010 Choose Y here if you have this FM radio chip.1111
+22-4
drivers/media/rc/imon.c
···4747#define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>"4848#define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display"4949#define MOD_NAME "imon"5050-#define MOD_VERSION "0.9.3"5050+#define MOD_VERSION "0.9.4"51515252#define DISPLAY_MINOR_BASE 1445353#define DEVICE_NAME "lcd%d"···16581658 return;1659165916601660 ictx = (struct imon_context *)urb->context;16611661- if (!ictx || !ictx->dev_present_intf0)16611661+ if (!ictx)16621662 return;16631663+16641664+ /*16651665+ * if we get a callback before we're done configuring the hardware, we16661666+ * can't yet process the data, as there's nowhere to send it, but we16671667+ * still need to submit a new rx URB to avoid wedging the hardware16681668+ */16691669+ if (!ictx->dev_present_intf0)16701670+ goto out;1663167116641672 switch (urb->status) {16651673 case -ENOENT: /* usbcore unlink successful! */···16861678 break;16871679 }1688168016811681+out:16891682 usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC);16901683}16911684···16991690 return;1700169117011692 ictx = (struct imon_context *)urb->context;17021702- if (!ictx || !ictx->dev_present_intf1)16931693+ if (!ictx)17031694 return;16951695+16961696+ /*16971697+ * if we get a callback before we're done configuring the hardware, we16981698+ * can't yet process the data, as there's nowhere to send it, but we16991699+ * still need to submit a new rx URB to avoid wedging the hardware17001700+ */17011701+ if (!ictx->dev_present_intf1)17021702+ goto out;1704170317051704 switch (urb->status) {17061705 case -ENOENT: /* usbcore unlink successful! */···17271710 break;17281711 }1729171217131713+out:17301714 usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC);17311715}17321716···22602242 mutex_unlock(&ictx->lock);22612243 usb_free_urb(rx_urb);22622244rx_urb_alloc_failed:22632263- dev_err(ictx->dev, "unable to initialize intf0, err %d\n", ret);22452245+ dev_err(ictx->dev, "unable to initialize intf1, err %d\n", ret);2264224622652247 return NULL;22662248}
+16-4
drivers/media/video/hdpvr/hdpvr-core.c
···154154 }155155#endif156156157157- v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n",158158- dev->usbc_buf[1], &dev->usbc_buf[2]);157157+ dev->fw_ver = dev->usbc_buf[1];159158160160- switch (dev->usbc_buf[1]) {159159+ v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n",160160+ dev->fw_ver, &dev->usbc_buf[2]);161161+162162+ if (dev->fw_ver > 0x15) {163163+ dev->options.brightness = 0x80;164164+ dev->options.contrast = 0x40;165165+ dev->options.hue = 0xf;166166+ dev->options.saturation = 0x40;167167+ dev->options.sharpness = 0x80;168168+ }169169+170170+ switch (dev->fw_ver) {161171 case HDPVR_FIRMWARE_VERSION:162172 dev->flags &= ~HDPVR_FLAG_AC3_CAP;163173 break;···179169 default:180170 v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might"181171 " not work.\n");182182- if (dev->usbc_buf[1] >= HDPVR_FIRMWARE_VERSION_AC3)172172+ if (dev->fw_ver >= HDPVR_FIRMWARE_VERSION_AC3)183173 dev->flags |= HDPVR_FLAG_AC3_CAP;184174 else185175 dev->flags &= ~HDPVR_FLAG_AC3_CAP;···280270 .bitrate_mode = HDPVR_CONSTANT,281271 .gop_mode = HDPVR_SIMPLE_IDR_GOP,282272 .audio_codec = V4L2_MPEG_AUDIO_ENCODING_AAC,273273+ /* original picture controls for firmware version <= 0x15 */274274+ /* updated in device_authorization() for newer firmware */283275 .brightness = 0x86,284276 .contrast = 0x80,285277 .hue = 0x80,
+33-13
drivers/media/video/hdpvr/hdpvr-video.c
···283283284284 hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00);285285286286+ dev->status = STATUS_STREAMING;287287+286288 INIT_WORK(&dev->worker, hdpvr_transmit_buffers);287289 queue_work(dev->workqueue, &dev->worker);288290289291 v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev,290292 "streaming started\n");291291- dev->status = STATUS_STREAMING;292293293294 return 0;294295 }···723722};724723725724static int fill_queryctrl(struct hdpvr_options *opt, struct v4l2_queryctrl *qc,726726- int ac3)725725+ int ac3, int fw_ver)727726{728727 int err;729728729729+ if (fw_ver > 0x15) {730730+ switch (qc->id) {731731+ case V4L2_CID_BRIGHTNESS:732732+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);733733+ case V4L2_CID_CONTRAST:734734+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40);735735+ case V4L2_CID_SATURATION:736736+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40);737737+ case V4L2_CID_HUE:738738+ return v4l2_ctrl_query_fill(qc, 0x0, 0x1e, 1, 0xf);739739+ case V4L2_CID_SHARPNESS:740740+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);741741+ }742742+ } else {743743+ switch (qc->id) {744744+ case V4L2_CID_BRIGHTNESS:745745+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86);746746+ case V4L2_CID_CONTRAST:747747+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);748748+ case V4L2_CID_SATURATION:749749+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);750750+ case V4L2_CID_HUE:751751+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);752752+ case V4L2_CID_SHARPNESS:753753+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);754754+ }755755+ }756756+730757 switch (qc->id) {731731- case V4L2_CID_BRIGHTNESS:732732- return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86);733733- case V4L2_CID_CONTRAST:734734- return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);735735- case V4L2_CID_SATURATION:736736- return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);737737- case V4L2_CID_HUE:738738- return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);739739- case V4L2_CID_SHARPNESS:740740- return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);741758 case V4L2_CID_MPEG_AUDIO_ENCODING:742759 return v4l2_ctrl_query_fill(743760 qc, V4L2_MPEG_AUDIO_ENCODING_AAC,···813794814795 if (qc->id == supported_v4l2_ctrls[i])815796 return fill_queryctrl(&dev->options, qc,816816- dev->flags & HDPVR_FLAG_AC3_CAP);797797+ dev->flags & HDPVR_FLAG_AC3_CAP,798798+ dev->fw_ver);817799818800 if (qc->id < supported_v4l2_ctrls[i])819801 break;
+1
drivers/media/video/hdpvr/hdpvr.h
···113113 /* usb control transfer buffer and lock */114114 struct mutex usbc_mutex;115115 u8 *usbc_buf;116116+ u8 fw_ver;116117};117118118119static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev)
···531531 for (port = 0; port < dev->caps.num_ports; port++) {532532 /* Change the port type only if the new type is different533533 * from the current, and not set to Auto */534534- if (port_types[port] != dev->caps.port_type[port + 1]) {534534+ if (port_types[port] != dev->caps.port_type[port + 1])535535 change = 1;536536- dev->caps.port_type[port + 1] = port_types[port];537537- }538536 }539537 if (change) {540538 mlx4_unregister_device(dev);541539 for (port = 1; port <= dev->caps.num_ports; port++) {542540 mlx4_CLOSE_PORT(dev, port);541541+ dev->caps.port_type[port] = port_types[port - 1];543542 err = mlx4_SET_PORT(dev, port);544543 if (err) {545544 mlx4_err(dev, "Failed to set port %d, "···984985 resource_size_t bf_start;985986 resource_size_t bf_len;986987 int err = 0;988988+989989+ if (!dev->caps.bf_reg_size)990990+ return -ENXIO;987991988992 bf_start = pci_resource_start(dev->pdev, 2) +989993 (dev->caps.num_uars << PAGE_SHIFT);···18271825 goto err_master_mfunc;1828182618291827 priv->msix_ctl.pool_bm = 0;18301830- spin_lock_init(&priv->msix_ctl.pool_lock);18281828+ mutex_init(&priv->msix_ctl.pool_lock);1831182918321830 mlx4_enable_msi_x(dev);18331831 if ((mlx4_is_mfunc(dev)) &&
···156156 if (unlikely(!skb))157157 return -ENOMEM;158158159159- /* Adjust the SKB for padding and checksum */159159+ /* Adjust the SKB for padding */160160 skb_reserve(skb, NET_IP_ALIGN);161161 rx_buf->len = skb_len - NET_IP_ALIGN;162162 rx_buf->is_page = false;163163- skb->ip_summed = CHECKSUM_UNNECESSARY;164163165164 rx_buf->dma_addr = pci_map_single(efx->pci_dev,166165 skb->data, rx_buf->len,···495496496497 EFX_BUG_ON_PARANOID(!checksummed);497498 rx_buf->u.skb = NULL;499499+ skb->ip_summed = CHECKSUM_UNNECESSARY;498500499501 gro_result = napi_gro_receive(napi, skb);500502 }
+4-2
drivers/net/ethernet/ti/davinci_emac.c
···10091009 int ret;1010101010111011 /* free and bail if we are shutting down */10121012- if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) {10121012+ if (unlikely(!netif_running(ndev))) {10131013 dev_kfree_skb_any(skb);10141014 return;10151015 }···10381038recycle:10391039 ret = cpdma_chan_submit(priv->rxchan, skb, skb->data,10401040 skb_tailroom(skb), GFP_KERNEL);10411041- if (WARN_ON(ret < 0))10411041+10421042+ WARN_ON(ret == -ENOMEM);10431043+ if (unlikely(ret < 0))10421044 dev_kfree_skb_any(skb);10431045}10441046
+35-20
drivers/net/phy/icplus.c
···3030#include <asm/irq.h>3131#include <asm/uaccess.h>32323333-MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IC1001 PHY drivers");3333+MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IP101G/IC1001 PHY drivers");3434MODULE_AUTHOR("Michael Barkowski");3535MODULE_LICENSE("GPL");36363737-/* IP101A/IP1001 */3838-#define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */3939-#define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */4040-#define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */4141-#define IP1001_APS_ON 11 /* IP1001 APS Mode bit */4242-#define IP101A_APS_ON 2 /* IP101A APS Mode bit */3737+/* IP101A/G - IP1001 */3838+#define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */3939+#define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */4040+#define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */4141+#define IP1001_APS_ON 11 /* IP1001 APS Mode bit */4242+#define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */43434444static int ip175c_config_init(struct phy_device *phydev)4545{···98989999static int ip1xx_reset(struct phy_device *phydev)100100{101101- int err, bmcr;101101+ int bmcr;102102103103 /* Software Reset PHY */104104 bmcr = phy_read(phydev, MII_BMCR);105105+ if (bmcr < 0)106106+ return bmcr;105107 bmcr |= BMCR_RESET;106106- err = phy_write(phydev, MII_BMCR, bmcr);107107- if (err < 0)108108- return err;108108+ bmcr = phy_write(phydev, MII_BMCR, bmcr);109109+ if (bmcr < 0)110110+ return bmcr;109111110112 do {111113 bmcr = phy_read(phydev, MII_BMCR);114114+ if (bmcr < 0)115115+ return bmcr;112116 } while (bmcr & BMCR_RESET);113117114114- return err;118118+ return 0;115119}116120117121static int ip1001_config_init(struct phy_device *phydev)···128124129125 /* Enable Auto Power Saving mode */130126 c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2);127127+ if (c < 0)128128+ return c;131129 c |= IP1001_APS_ON;130130+ c = phy_write(phydev, IP1001_SPEC_CTRL_STATUS_2, c);132131 if (c < 0)133132 return c;134133···139132 /* Additional delay (2ns) used to adjust RX clock phase140133 * at RGMII interface */141134 c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);135135+ if (c < 0)136136+ return c;137137+142138 c |= IP1001_PHASE_SEL_MASK;143139 c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);140140+ if (c < 0)141141+ return c;144142 }145143146146- return c;144144+ return 0;147145}148146149149-static int ip101a_config_init(struct phy_device *phydev)147147+static int ip101a_g_config_init(struct phy_device *phydev)150148{151149 int c;152150···161149162150 /* Enable Auto Power Saving mode */163151 c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);164164- c |= IP101A_APS_ON;152152+ c |= IP101A_G_APS_ON;165153 return c;166154}167155···203191 .phy_id_mask = 0x0ffffff0,204192 .features = PHY_GBIT_FEATURES | SUPPORTED_Pause |205193 SUPPORTED_Asym_Pause,194194+ .flags = PHY_HAS_INTERRUPT,206195 .config_init = &ip1001_config_init,207196 .config_aneg = &genphy_config_aneg,208197 .read_status = &genphy_read_status,···212199 .driver = { .owner = THIS_MODULE,},213200};214201215215-static struct phy_driver ip101a_driver = {202202+static struct phy_driver ip101a_g_driver = {216203 .phy_id = 0x02430c54,217217- .name = "ICPlus IP101A",204204+ .name = "ICPlus IP101A/G",218205 .phy_id_mask = 0x0ffffff0,219206 .features = PHY_BASIC_FEATURES | SUPPORTED_Pause |220207 SUPPORTED_Asym_Pause,221221- .config_init = &ip101a_config_init,208208+ .flags = PHY_HAS_INTERRUPT,209209+ .config_init = &ip101a_g_config_init,222210 .config_aneg = &genphy_config_aneg,223211 .read_status = &genphy_read_status,224212 .suspend = genphy_suspend,···235221 if (ret < 0)236222 return -ENODEV;237223238238- ret = phy_driver_register(&ip101a_driver);224224+ ret = phy_driver_register(&ip101a_g_driver);239225 if (ret < 0)240226 return -ENODEV;241227···245231static void __exit icplus_exit(void)246232{247233 phy_driver_unregister(&ip1001_driver);248248- phy_driver_unregister(&ip101a_driver);234234+ phy_driver_unregister(&ip101a_g_driver);249235 phy_driver_unregister(&ip175c_driver);250236}251237···255241static struct mdio_device_id __maybe_unused icplus_tbl[] = {256242 { 0x02430d80, 0x0ffffff0 },257243 { 0x02430d90, 0x0ffffff0 },244244+ { 0x02430c54, 0x0ffffff0 },258245 { }259246};260247
+23
drivers/net/ppp/ppp_generic.c
···20242024 continue;20252025 }20262026 if (PPP_MP_CB(p)->sequence != seq) {20272027+ u32 oldseq;20272028 /* Fragment `seq' is missing. If it is after20282029 minseq, it might arrive later, so stop here. */20292030 if (seq_after(seq, minseq))20302031 break;20312032 /* Fragment `seq' is lost, keep going. */20322033 lost = 1;20342034+ oldseq = seq;20332035 seq = seq_before(minseq, PPP_MP_CB(p)->sequence)?20342036 minseq + 1: PPP_MP_CB(p)->sequence;20372037+20382038+ if (ppp->debug & 1)20392039+ netdev_printk(KERN_DEBUG, ppp->dev,20402040+ "lost frag %u..%u\n",20412041+ oldseq, seq-1);20422042+20352043 goto again;20362044 }20372045···20842076 struct sk_buff *tmp2;2085207720862078 skb_queue_reverse_walk_from_safe(list, p, tmp2) {20792079+ if (ppp->debug & 1)20802080+ netdev_printk(KERN_DEBUG, ppp->dev,20812081+ "discarding frag %u\n",20822082+ PPP_MP_CB(p)->sequence);20872083 __skb_unlink(p, list);20882084 kfree_skb(p);20892085 }···21032091 /* If we have discarded any fragments,21042092 signal a receive error. */21052093 if (PPP_MP_CB(head)->sequence != ppp->nextseq) {20942094+ skb_queue_walk_safe(list, p, tmp) {20952095+ if (p == head)20962096+ break;20972097+ if (ppp->debug & 1)20982098+ netdev_printk(KERN_DEBUG, ppp->dev,20992099+ "discarding frag %u\n",21002100+ PPP_MP_CB(p)->sequence);21012101+ __skb_unlink(p, list);21022102+ kfree_skb(p);21032103+ }21042104+21062105 if (ppp->debug & 1)21072106 netdev_printk(KERN_DEBUG, ppp->dev,21082107 " missed pkts %u..%u\n",
···13461346 fc = hdr->frame_control;13471347 for (i = 0; i < sc->hw->max_rates; i++) {13481348 struct ieee80211_tx_rate *rate = &tx_info->status.rates[i];13491349- if (!rate->count)13491349+ if (rate->idx < 0 || !rate->count)13501350 break;1351135113521352 final_ts_idx = i;
+7-1
drivers/net/wireless/mwifiex/cfg80211.c
···841841 ret = mwifiex_set_rf_channel(priv, channel,842842 priv->adapter->channel_type);843843844844- ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); /* Disable keys */844844+ /* As this is new association, clear locally stored845845+ * keys and security related flags */846846+ priv->sec_info.wpa_enabled = false;847847+ priv->sec_info.wpa2_enabled = false;848848+ priv->wep_key_curr_index = 0;849849+ ret = mwifiex_set_encode(priv, NULL, 0, 0, 1);845850846851 if (mode == NL80211_IFTYPE_ADHOC) {847852 /* "privacy" is set only for ad-hoc mode */···891886 dev_dbg(priv->adapter->dev,892887 "info: setting wep encryption"893888 " with key len %d\n", sme->key_len);889889+ priv->wep_key_curr_index = sme->key_idx;894890 ret = mwifiex_set_encode(priv, sme->key, sme->key_len,895891 sme->key_idx, 0);896892 }
+2
drivers/parisc/iommu-helpers.h
···11+#include <linux/prefetch.h>22+13/**24 * iommu_fill_pdir - Insert coalesced scatter/gather chunks into the I/O Pdir.35 * @ioc: The I/O Controller.
···46134613 ENTER;46144614 ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata;4615461546164616- dev_err(&ioa_cfg->pdev->dev,46174617- "Adapter being reset as a result of error recovery.\n");46164616+ if (!ioa_cfg->in_reset_reload) {46174617+ dev_err(&ioa_cfg->pdev->dev,46184618+ "Adapter being reset as a result of error recovery.\n");4618461946194619- if (WAIT_FOR_DUMP == ioa_cfg->sdt_state)46204620- ioa_cfg->sdt_state = GET_DUMP;46204620+ if (WAIT_FOR_DUMP == ioa_cfg->sdt_state)46214621+ ioa_cfg->sdt_state = GET_DUMP;46224622+ }4621462346224624 rc = ipr_reset_reload(ioa_cfg, IPR_SHUTDOWN_ABBREV);46234625···49094907 struct ipr_ioa_cfg *ioa_cfg;49104908 struct ipr_resource_entry *res;49114909 struct ipr_cmd_pkt *cmd_pkt;49124912- u32 ioasc;49104910+ u32 ioasc, int_reg;49134911 int op_found = 0;4914491249154913 ENTER;···49224920 */49234921 if (ioa_cfg->in_reset_reload || ioa_cfg->ioa_is_dead)49244922 return FAILED;49254925- if (!res || !ipr_is_gscsi(res))49234923+ if (!res)49244924+ return FAILED;49254925+49264926+ /*49274927+ * If we are aborting a timed out op, chances are that the timeout was caused49284928+ * by a still not detected EEH error. In such cases, reading a register will49294929+ * trigger the EEH recovery infrastructure.49304930+ */49314931+ int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);49324932+49334933+ if (!ipr_is_gscsi(res))49264934 return FAILED;4927493549284936 list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) {
+3-1
drivers/scsi/isci/host.c
···18481848 if (state == SCIC_RESET ||18491849 state == SCIC_INITIALIZING ||18501850 state == SCIC_INITIALIZED) {18511851+ u8 oem_version = pci_info->orom ? pci_info->orom->hdr.version :18521852+ ISCI_ROM_VER_1_0;1851185318521854 if (sci_oem_parameters_validate(&ihost->oem_parameters,18531853- pci_info->orom->hdr.version))18551855+ oem_version))18541856 return SCI_FAILURE_INVALID_PARAMETER_VALUE;1855185718561858 return SCI_SUCCESS;
···18151815 }18161816 spin_unlock(&async_scan_lock);1817181718181818+ scsi_autopm_put_host(shost);18181819 scsi_host_put(shost);18191820 kfree(data);18201821}···1842184118431842 do_scsi_scan_host(shost);18441843 scsi_finish_async_scan(data);18451845- scsi_autopm_put_host(shost);18461844 return 0;18471845}18481846···18691869 p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no);18701870 if (IS_ERR(p))18711871 do_scan_async(data);18721872- /* scsi_autopm_put_host(shost) is called in do_scan_async() */18721872+ /* scsi_autopm_put_host(shost) is called in scsi_finish_async_scan() */18731873}18741874EXPORT_SYMBOL(scsi_scan_host);18751875
+1-1
drivers/sh/clk/cpg.c
···190190 return -EINVAL;191191 }192192193193- clk->parent = clk->parent_table[val];193193+ clk_reparent(clk, clk->parent_table[val]);194194 if (!clk->parent) {195195 pr_err("sh_clk_init_parent: unable to set parent");196196 return -EINVAL;
+4-1
drivers/usb/core/hcd-pci.c
···187187 return -ENODEV;188188 dev->current_state = PCI_D0;189189190190- if (!dev->irq) {190190+ /* The xHCI driver supports MSI and MSI-X,191191+ * so don't fail if the BIOS doesn't provide a legacy IRQ.192192+ */193193+ if (!dev->irq && (driver->flags & HCD_MASK) != HCD_USB3) {191194 dev_err(&dev->dev,192195 "Found HC with no IRQ. Check BIOS/PCI %s setup!\n",193196 pci_name(dev));
+4-2
drivers/usb/core/hcd.c
···24472447 && device_can_wakeup(&hcd->self.root_hub->dev))24482448 dev_dbg(hcd->self.controller, "supports USB remote wakeup\n");2449244924502450- /* enable irqs just before we start the controller */24512451- if (usb_hcd_is_primary_hcd(hcd)) {24502450+ /* enable irqs just before we start the controller,24512451+ * if the BIOS provides legacy PCI irqs.24522452+ */24532453+ if (usb_hcd_is_primary_hcd(hcd) && irqnum) {24522454 retval = usb_hcd_request_irqs(hcd, irqnum, irqflags);24532455 if (retval)24542456 goto err_request_irq;
+17-13
drivers/usb/core/hub.c
···705705 if (type == HUB_INIT3)706706 goto init3;707707708708- /* After a resume, port power should still be on.708708+ /* The superspeed hub except for root hub has to use Hub Depth709709+ * value as an offset into the route string to locate the bits710710+ * it uses to determine the downstream port number. So hub driver711711+ * should send a set hub depth request to superspeed hub after712712+ * the superspeed hub is set configuration in initialization or713713+ * reset procedure.714714+ *715715+ * After a resume, port power should still be on.709716 * For any other type of activation, turn it on.710717 */711718 if (type != HUB_RESUME) {719719+ if (hdev->parent && hub_is_superspeed(hdev)) {720720+ ret = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),721721+ HUB_SET_DEPTH, USB_RT_HUB,722722+ hdev->level - 1, 0, NULL, 0,723723+ USB_CTRL_SET_TIMEOUT);724724+ if (ret < 0)725725+ dev_err(hub->intfdev,726726+ "set hub depth failed\n");727727+ }712728713729 /* Speed up system boot by using a delayed_work for the714730 * hub's initial power-up delays. This is pretty awkward···1001985 if (!hub->descriptor) {1002986 ret = -ENOMEM;1003987 goto fail;10041004- }10051005-10061006- if (hub_is_superspeed(hdev) && (hdev->parent != NULL)) {10071007- ret = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),10081008- HUB_SET_DEPTH, USB_RT_HUB,10091009- hdev->level - 1, 0, NULL, 0,10101010- USB_CTRL_SET_TIMEOUT);10111011-10121012- if (ret < 0) {10131013- message = "can't set hub depth";10141014- goto fail;10151015- }1016988 }10179891018990 /* Request the entire hub descriptor.
···9393 */9494 memset(port_removable, 0, sizeof(port_removable));9595 for (i = 0; i < ports; i++) {9696- portsc = xhci_readl(xhci, xhci->usb3_ports[i]);9696+ portsc = xhci_readl(xhci, xhci->usb2_ports[i]);9797 /* If a device is removable, PORTSC reports a 0, same as in the9898 * hub descriptor DeviceRemovable bits.9999 */
+24-8
drivers/usb/host/xhci-mem.c
···11261126}1127112711281128/*11291129- * Convert bInterval expressed in frames (in 1-255 range) to exponent of11291129+ * Convert bInterval expressed in microframes (in 1-255 range) to exponent of11301130 * microframes, rounded down to nearest power of 2.11311131 */11321132-static unsigned int xhci_parse_frame_interval(struct usb_device *udev,11331133- struct usb_host_endpoint *ep)11321132+static unsigned int xhci_microframes_to_exponent(struct usb_device *udev,11331133+ struct usb_host_endpoint *ep, unsigned int desc_interval,11341134+ unsigned int min_exponent, unsigned int max_exponent)11341135{11351136 unsigned int interval;1136113711371137- interval = fls(8 * ep->desc.bInterval) - 1;11381138- interval = clamp_val(interval, 3, 10);11391139- if ((1 << interval) != 8 * ep->desc.bInterval)11381138+ interval = fls(desc_interval) - 1;11391139+ interval = clamp_val(interval, min_exponent, max_exponent);11401140+ if ((1 << interval) != desc_interval)11401141 dev_warn(&udev->dev,11411142 "ep %#x - rounding interval to %d microframes, ep desc says %d microframes\n",11421143 ep->desc.bEndpointAddress,11431144 1 << interval,11441144- 8 * ep->desc.bInterval);11451145+ desc_interval);1145114611461147 return interval;11481148+}11491149+11501150+static unsigned int xhci_parse_microframe_interval(struct usb_device *udev,11511151+ struct usb_host_endpoint *ep)11521152+{11531153+ return xhci_microframes_to_exponent(udev, ep,11541154+ ep->desc.bInterval, 0, 15);11551155+}11561156+11571157+11581158+static unsigned int xhci_parse_frame_interval(struct usb_device *udev,11591159+ struct usb_host_endpoint *ep)11601160+{11611161+ return xhci_microframes_to_exponent(udev, ep,11621162+ ep->desc.bInterval * 8, 3, 10);11471163}1148116411491165/* Return the polling or NAK interval.···11801164 /* Max NAK rate */11811165 if (usb_endpoint_xfer_control(&ep->desc) ||11821166 usb_endpoint_xfer_bulk(&ep->desc)) {11831183- interval = ep->desc.bInterval;11671167+ interval = xhci_parse_microframe_interval(udev, ep);11841168 break;11851169 }11861170 /* Fall through - SS and HS isoc/int have same decoding */
+5
drivers/usb/host/xhci.c
···352352 /* hcd->irq is -1, we have MSI */353353 return 0;354354355355+ if (!pdev->irq) {356356+ xhci_err(xhci, "No msi-x/msi found and no IRQ in BIOS\n");357357+ return -EINVAL;358358+ }359359+355360 /* fall back to legacy interrupt*/356361 ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED,357362 hcd->irq_descr, hcd);
+2
drivers/usb/serial/cp210x.c
···136136 { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */137137 { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */138138 { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */139139+ { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */140140+ { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */139141 { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */140142 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */141143 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
···788788 struct Scsi_Host *host = us_to_host(us);789789790790 /* If the device is really gone, cut short reset delays */791791- if (us->pusb_dev->state == USB_STATE_NOTATTACHED)791791+ if (us->pusb_dev->state == USB_STATE_NOTATTACHED) {792792 set_bit(US_FLIDX_DISCONNECTING, &us->dflags);793793+ wake_up(&us->delay_wait);794794+ }793795794794- /* Prevent SCSI-scanning (if it hasn't started yet)795795- * and wait for the SCSI-scanning thread to stop.796796+ /* Prevent SCSI scanning (if it hasn't started yet)797797+ * or wait for the SCSI-scanning routine to stop.796798 */797797- set_bit(US_FLIDX_DONT_SCAN, &us->dflags);798798- wake_up(&us->delay_wait);799799- wait_for_completion(&us->scanning_done);799799+ cancel_delayed_work_sync(&us->scan_dwork);800800+801801+ /* Balance autopm calls if scanning was cancelled */802802+ if (test_bit(US_FLIDX_SCAN_PENDING, &us->dflags))803803+ usb_autopm_put_interface_no_suspend(us->pusb_intf);800804801805 /* Removing the host will perform an orderly shutdown: caches802806 * synchronized, disks spun down, etc.···827823 scsi_host_put(us_to_host(us));828824}829825830830-/* Thread to carry out delayed SCSI-device scanning */831831-static int usb_stor_scan_thread(void * __us)826826+/* Delayed-work routine to carry out SCSI-device scanning */827827+static void usb_stor_scan_dwork(struct work_struct *work)832828{833833- struct us_data *us = (struct us_data *)__us;829829+ struct us_data *us = container_of(work, struct us_data,830830+ scan_dwork.work);834831 struct device *dev = &us->pusb_intf->dev;835832836836- dev_dbg(dev, "device found\n");833833+ dev_dbg(dev, "starting scan\n");837834838838- set_freezable();839839-840840- /*841841- * Wait for the timeout to expire or for a disconnect842842- *843843- * We can't freeze in this thread or we risk causing khubd to844844- * fail to freeze, but we can't be non-freezable either. Nor can845845- * khubd freeze while waiting for scanning to complete as it may846846- * hold the device lock, causing a hang when suspending devices.847847- * So instead of using wait_event_freezable(), explicitly test848848- * for (DONT_SCAN || freezing) in interruptible wait and proceed849849- * if any of DONT_SCAN, freezing or timeout has happened.850850- */851851- if (delay_use > 0) {852852- dev_dbg(dev, "waiting for device to settle "853853- "before scanning\n");854854- wait_event_interruptible_timeout(us->delay_wait,855855- test_bit(US_FLIDX_DONT_SCAN, &us->dflags) ||856856- freezing(current), delay_use * HZ);835835+ /* For bulk-only devices, determine the max LUN value */836836+ if (us->protocol == USB_PR_BULK && !(us->fflags & US_FL_SINGLE_LUN)) {837837+ mutex_lock(&us->dev_mutex);838838+ us->max_lun = usb_stor_Bulk_max_lun(us);839839+ mutex_unlock(&us->dev_mutex);857840 }841841+ scsi_scan_host(us_to_host(us));842842+ dev_dbg(dev, "scan complete\n");858843859859- /* If the device is still connected, perform the scanning */860860- if (!test_bit(US_FLIDX_DONT_SCAN, &us->dflags)) {861861-862862- /* For bulk-only devices, determine the max LUN value */863863- if (us->protocol == USB_PR_BULK &&864864- !(us->fflags & US_FL_SINGLE_LUN)) {865865- mutex_lock(&us->dev_mutex);866866- us->max_lun = usb_stor_Bulk_max_lun(us);867867- mutex_unlock(&us->dev_mutex);868868- }869869- scsi_scan_host(us_to_host(us));870870- dev_dbg(dev, "scan complete\n");871871-872872- /* Should we unbind if no devices were detected? */873873- }844844+ /* Should we unbind if no devices were detected? */874845875846 usb_autopm_put_interface(us->pusb_intf);876876- complete_and_exit(&us->scanning_done, 0);847847+ clear_bit(US_FLIDX_SCAN_PENDING, &us->dflags);877848}878849879850static unsigned int usb_stor_sg_tablesize(struct usb_interface *intf)···895916 init_completion(&us->cmnd_ready);896917 init_completion(&(us->notify));897918 init_waitqueue_head(&us->delay_wait);898898- init_completion(&us->scanning_done);919919+ INIT_DELAYED_WORK(&us->scan_dwork, usb_stor_scan_dwork);899920900921 /* Associate the us_data structure with the USB device */901922 result = associate_dev(us, intf);···926947/* Second part of general USB mass-storage probing */927948int usb_stor_probe2(struct us_data *us)928949{929929- struct task_struct *th;930950 int result;931951 struct device *dev = &us->pusb_intf->dev;932952···966988 goto BadDevice;967989 }968990969969- /* Start up the thread for delayed SCSI-device scanning */970970- th = kthread_create(usb_stor_scan_thread, us, "usb-stor-scan");971971- if (IS_ERR(th)) {972972- dev_warn(dev,973973- "Unable to start the device-scanning thread\n");974974- complete(&us->scanning_done);975975- quiesce_and_remove_host(us);976976- result = PTR_ERR(th);977977- goto BadDevice;978978- }979979-991991+ /* Submit the delayed_work for SCSI-device scanning */980992 usb_autopm_get_interface_no_resume(us->pusb_intf);981981- wake_up_process(th);993993+ set_bit(US_FLIDX_SCAN_PENDING, &us->dflags);982994995995+ if (delay_use > 0)996996+ dev_dbg(dev, "waiting for device to settle before scanning\n");997997+ queue_delayed_work(system_freezable_wq, &us->scan_dwork,998998+ delay_use * HZ);983999 return 0;98410009851001 /* We come here if there are any problems */
+4-3
drivers/usb/storage/usb.h
···4747#include <linux/blkdev.h>4848#include <linux/completion.h>4949#include <linux/mutex.h>5050+#include <linux/workqueue.h>5051#include <scsi/scsi_host.h>51525253struct us_data;···7372#define US_FLIDX_DISCONNECTING 3 /* disconnect in progress */7473#define US_FLIDX_RESETTING 4 /* device reset in progress */7574#define US_FLIDX_TIMED_OUT 5 /* SCSI midlayer timed out */7676-#define US_FLIDX_DONT_SCAN 6 /* don't scan (disconnect) */7575+#define US_FLIDX_SCAN_PENDING 6 /* scanning not yet done */7776#define US_FLIDX_REDO_READ10 7 /* redo READ(10) command */7877#define US_FLIDX_READ10_WORKED 8 /* previous READ(10) succeeded */7978···148147 /* mutual exclusion and synchronization structures */149148 struct completion cmnd_ready; /* to sleep thread on */150149 struct completion notify; /* thread begin/end */151151- wait_queue_head_t delay_wait; /* wait during scan, reset */152152- struct completion scanning_done; /* wait for scan thread */150150+ wait_queue_head_t delay_wait; /* wait during reset */151151+ struct delayed_work scan_dwork; /* for async scanning */153152154153 /* subdriver information */155154 void *extra; /* Any extra data */
+1-1
drivers/video/omap2/displays/Kconfig
···12121313config PANEL_DVI1414 tristate "DVI output"1515- depends on OMAP2_DSS_DPI1515+ depends on OMAP2_DSS_DPI && I2C1616 help1717 Driver for external monitors, connected via DVI. The driver uses i2c1818 to read EDID information from the monitor.
+23-1
drivers/video/omap2/dss/hdmi.c
···130130131131 DSSDBG("hdmi_runtime_get\n");132132133133+ /*134134+ * HACK: Add dss_runtime_get() to ensure DSS clock domain is enabled.135135+ * This should be removed later.136136+ */137137+ r = dss_runtime_get();138138+ if (r < 0)139139+ goto err_get_dss;140140+133141 r = pm_runtime_get_sync(&hdmi.pdev->dev);134142 WARN_ON(r < 0);135135- return r < 0 ? r : 0;143143+ if (r < 0)144144+ goto err_get_hdmi;145145+146146+ return 0;147147+148148+err_get_hdmi:149149+ dss_runtime_put();150150+err_get_dss:151151+ return r;136152}137153138154static void hdmi_runtime_put(void)···159143160144 r = pm_runtime_put_sync(&hdmi.pdev->dev);161145 WARN_ON(r < 0);146146+147147+ /*148148+ * HACK: This is added to complement the dss_runtime_get() call in149149+ * hdmi_runtime_get(). This should be removed later.150150+ */151151+ dss_runtime_put();162152}163153164154int hdmi_init_display(struct omap_dss_device *dssdev)
+1-8
drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
···479479480480bool ti_hdmi_4xxx_detect(struct hdmi_ip_data *ip_data)481481{482482- int r;483483-484484- void __iomem *base = hdmi_core_sys_base(ip_data);485485-486486- /* HPD */487487- r = REG_GET(base, HDMI_CORE_SYS_SYS_STAT, 1, 1);488488-489489- return r == 1;482482+ return gpio_get_value(ip_data->hpd_gpio);490483}491484492485static void hdmi_core_init(struct hdmi_core_video_config *video_cfg,
···18101810 break;18111811 }1812181218131813+ /* magic required on VX900 for correct modesetting on IGA1 */18141814+ via_write_reg_mask(VIACR, 0x45, 0x00, 0x01);18151815+18131816 /* probably this should go to the scaling code one day */18171817+ via_write_reg_mask(VIACR, 0xFD, 0, 0x80); /* VX900 hw scale on IGA2 */18141818 viafb_write_regx(scaling_parameters, ARRAY_SIZE(scaling_parameters));1815181918161820 /* Fill VPIT Parameters */
+22-11
drivers/virtio/virtio_balloon.c
···367367#ifdef CONFIG_PM368368static int virtballoon_freeze(struct virtio_device *vdev)369369{370370+ struct virtio_balloon *vb = vdev->priv;371371+370372 /*371373 * The kthread is already frozen by the PM core before this372374 * function is called.373375 */376376+377377+ while (vb->num_pages)378378+ leak_balloon(vb, vb->num_pages);379379+ update_balloon_size(vb);374380375381 /* Ensure we don't get any more requests from the host */376382 vdev->config->reset(vdev);···384378 return 0;385379}386380381381+static int restore_common(struct virtio_device *vdev)382382+{383383+ struct virtio_balloon *vb = vdev->priv;384384+ int ret;385385+386386+ ret = init_vqs(vdev->priv);387387+ if (ret)388388+ return ret;389389+390390+ fill_balloon(vb, towards_target(vb));391391+ update_balloon_size(vb);392392+ return 0;393393+}394394+387395static int virtballoon_thaw(struct virtio_device *vdev)388396{389389- return init_vqs(vdev->priv);397397+ return restore_common(vdev);390398}391399392400static int virtballoon_restore(struct virtio_device *vdev)393401{394402 struct virtio_balloon *vb = vdev->priv;395395- struct page *page, *page2;396396-397397- /* We're starting from a clean slate */398398- vb->num_pages = 0;399403400404 /*401405 * If a request wasn't complete at the time of freezing, this···413397 */414398 vb->need_stats_update = 0;415399416416- /* We don't have these pages in the balloon anymore! */417417- list_for_each_entry_safe(page, page2, &vb->pages, lru) {418418- list_del(&page->lru);419419- totalram_pages++;420420- }421421- return init_vqs(vdev->priv);400400+ return restore_common(vdev);422401}423402#endif424403
+1-1
drivers/watchdog/Kconfig
···10981098 For Freescale Book-E processors, this is a number between 0 and 63.10991099 For other Book-E processors, this is a number between 0 and 3.1100110011011101- The value can be overidden by the wdt_period command-line parameter.11011101+ The value can be overridden by the wdt_period command-line parameter.1102110211031103# PPC64 Architecture11041104
···264264 wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);265265 if (wdt_mem == NULL) {266266 printk(KERN_INFO MODULE_NAME267267- "failed to get memory region resouce\n");267267+ "failed to get memory region resource\n");268268 return -ENOENT;269269 }270270
+31-26
drivers/watchdog/s3c2410_wdt.c
···312312 dev = &pdev->dev;313313 wdt_dev = &pdev->dev;314314315315- /* get the memory region for the watchdog timer */316316-317315 wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);318316 if (wdt_mem == NULL) {319317 dev_err(dev, "no memory resource specified\n");320318 return -ENOENT;321319 }322320321321+ wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);322322+ if (wdt_irq == NULL) {323323+ dev_err(dev, "no irq resource specified\n");324324+ ret = -ENOENT;325325+ goto err;326326+ }327327+328328+ /* get the memory region for the watchdog timer */329329+323330 size = resource_size(wdt_mem);324331 if (!request_mem_region(wdt_mem->start, size, pdev->name)) {325332 dev_err(dev, "failed to get memory region\n");326326- return -EBUSY;333333+ ret = -EBUSY;334334+ goto err;327335 }328336329337 wdt_base = ioremap(wdt_mem->start, size);···343335344336 DBG("probe: mapped wdt_base=%p\n", wdt_base);345337346346- wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);347347- if (wdt_irq == NULL) {348348- dev_err(dev, "no irq resource specified\n");349349- ret = -ENOENT;350350- goto err_map;351351- }352352-353353- ret = request_irq(wdt_irq->start, s3c2410wdt_irq, 0, pdev->name, pdev);354354- if (ret != 0) {355355- dev_err(dev, "failed to install irq (%d)\n", ret);356356- goto err_map;357357- }358358-359338 wdt_clock = clk_get(&pdev->dev, "watchdog");360339 if (IS_ERR(wdt_clock)) {361340 dev_err(dev, "failed to find watchdog clock source\n");362341 ret = PTR_ERR(wdt_clock);363363- goto err_irq;342342+ goto err_map;364343 }365344366345 clk_enable(wdt_clock);367346368368- if (s3c2410wdt_cpufreq_register() < 0) {347347+ ret = s3c2410wdt_cpufreq_register();348348+ if (ret < 0) {369349 printk(KERN_ERR PFX "failed to register cpufreq\n");370350 goto err_clk;371351 }···374378 "cannot start\n");375379 }376380381381+ ret = request_irq(wdt_irq->start, s3c2410wdt_irq, 0, pdev->name, pdev);382382+ if (ret != 0) {383383+ dev_err(dev, "failed to install irq (%d)\n", ret);384384+ goto err_cpufreq;385385+ }386386+377387 watchdog_set_nowayout(&s3c2410_wdd, nowayout);378388379389 ret = watchdog_register_device(&s3c2410_wdd);380390 if (ret) {381391 dev_err(dev, "cannot register watchdog (%d)\n", ret);382382- goto err_cpufreq;392392+ goto err_irq;383393 }384394385395 if (tmr_atboot && started == 0) {···410408411409 return 0;412410411411+ err_irq:412412+ free_irq(wdt_irq->start, pdev);413413+413414 err_cpufreq:414415 s3c2410wdt_cpufreq_deregister();415416416417 err_clk:417418 clk_disable(wdt_clock);418419 clk_put(wdt_clock);419419-420420- err_irq:421421- free_irq(wdt_irq->start, pdev);420420+ wdt_clock = NULL;422421423422 err_map:424423 iounmap(wdt_base);425424426425 err_req:427426 release_mem_region(wdt_mem->start, size);428428- wdt_mem = NULL;429427428428+ err:429429+ wdt_irq = NULL;430430+ wdt_mem = NULL;430431 return ret;431432}432433···437432{438433 watchdog_unregister_device(&s3c2410_wdd);439434435435+ free_irq(wdt_irq->start, dev);436436+440437 s3c2410wdt_cpufreq_deregister();441438442439 clk_disable(wdt_clock);443440 clk_put(wdt_clock);444441 wdt_clock = NULL;445442446446- free_irq(wdt_irq->start, dev);447447- wdt_irq = NULL;448448-449443 iounmap(wdt_base);450444451445 release_mem_region(wdt_mem->start, resource_size(wdt_mem));446446+ wdt_irq = NULL;452447 wdt_mem = NULL;453448 return 0;454449}
+1
fs/autofs4/autofs_i.h
···110110 int sub_version;111111 int min_proto;112112 int max_proto;113113+ int compat_daemon;113114 unsigned long exp_timeout;114115 unsigned int type;115116 int reghost_enabled;
···91919292 return (bytes > 0);9393}9494-9494+9595+/*9696+ * The autofs_v5 packet was misdesigned.9797+ *9898+ * The packets are identical on x86-32 and x86-64, but have different9999+ * alignment. Which means that 'sizeof()' will give different results.100100+ * Fix it up for the case of running 32-bit user mode on a 64-bit kernel.101101+ */102102+static noinline size_t autofs_v5_packet_size(struct autofs_sb_info *sbi)103103+{104104+ size_t pktsz = sizeof(struct autofs_v5_packet);105105+#if defined(CONFIG_X86_64) && defined(CONFIG_COMPAT)106106+ if (sbi->compat_daemon > 0)107107+ pktsz -= 4;108108+#endif109109+ return pktsz;110110+}111111+95112static void autofs4_notify_daemon(struct autofs_sb_info *sbi,96113 struct autofs_wait_queue *wq,97114 int type)···172155 {173156 struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet;174157175175- pktsz = sizeof(*packet);176176-158158+ pktsz = autofs_v5_packet_size(sbi);177159 packet->wait_queue_token = wq->wait_queue_token;178160 packet->len = wq->name.len;179161 memcpy(packet->name, wq->name.name, wq->name.len);
+1-1
fs/binfmt_elf.c
···14211421 for (i = 1; i < view->n; ++i) {14221422 const struct user_regset *regset = &view->regsets[i];14231423 do_thread_regset_writeback(t->task, regset);14241424- if (regset->core_note_type &&14241424+ if (regset->core_note_type && regset->get &&14251425 (!regset->active || regset->active(t->task, regset))) {14261426 int ret;14271427 size_t size = regset->n * regset->size;
+2
fs/btrfs/backref.c
···892892 if (eb != eb_in)893893 free_extent_buffer(eb);894894 ret = inode_ref_info(parent, 0, fs_root, path, &found_key);895895+ if (ret > 0)896896+ ret = -ENOENT;895897 if (ret)896898 break;897899 next_inum = found_key.offset;
+1-1
fs/btrfs/check-integrity.c
···644644static int btrfsic_process_superblock(struct btrfsic_state *state,645645 struct btrfs_fs_devices *fs_devices)646646{647647- int ret;647647+ int ret = 0;648648 struct btrfs_super_block *selected_super;649649 struct list_head *dev_head = &fs_devices->devices;650650 struct btrfs_device *device;
···2626 unsigned long flags;2727 struct block_device *bdev;2828 atomic_t refs;2929- unsigned int in_tree:1;3030- unsigned int compress_type:4;2929+ unsigned int in_tree;3030+ unsigned int compress_type;3131};32323333struct extent_map_tree {
+12-17
fs/btrfs/file.c
···16051605 return -EOPNOTSUPP;1606160616071607 /*16081608+ * Make sure we have enough space before we do the16091609+ * allocation.16101610+ */16111611+ ret = btrfs_check_data_free_space(inode, len);16121612+ if (ret)16131613+ return ret;16141614+16151615+ /*16081616 * wait for ordered IO before we have any locks. We'll loop again16091617 * below with the locks held.16101618 */···16751667 if (em->block_start == EXTENT_MAP_HOLE ||16761668 (cur_offset >= inode->i_size &&16771669 !test_bit(EXTENT_FLAG_PREALLOC, &em->flags))) {16781678-16791679- /*16801680- * Make sure we have enough space before we do the16811681- * allocation.16821682- */16831683- ret = btrfs_check_data_free_space(inode, last_byte -16841684- cur_offset);16851685- if (ret) {16861686- free_extent_map(em);16871687- break;16881688- }16891689-16901670 ret = btrfs_prealloc_file_range(inode, mode, cur_offset,16911671 last_byte - cur_offset,16921672 1 << inode->i_blkbits,16931673 offset + len,16941674 &alloc_hint);1695167516961696- /* Let go of our reservation. */16971697- btrfs_free_reserved_data_space(inode, last_byte -16981698- cur_offset);16991676 if (ret < 0) {17001677 free_extent_map(em);17011678 break;···17081715 &cached_state, GFP_NOFS);17091716out:17101717 mutex_unlock(&inode->i_mutex);17181718+ /* Let go of our reservation. */17191719+ btrfs_free_reserved_data_space(inode, len);17111720 return ret;17121721}17131722···17561761 start - root->sectorsize,17571762 root->sectorsize, 0);17581763 if (IS_ERR(em)) {17591759- ret = -ENXIO;17641764+ ret = PTR_ERR(em);17601765 goto out;17611766 }17621767 last_end = em->start + em->len;···17681773 while (1) {17691774 em = btrfs_get_extent_fiemap(inode, NULL, 0, start, len, 0);17701775 if (IS_ERR(em)) {17711771- ret = -ENXIO;17761776+ ret = PTR_ERR(em);17721777 break;17731778 }17741779
···459459{460460 struct btrfs_device *device, *next;461461462462+ struct block_device *latest_bdev = NULL;463463+ u64 latest_devid = 0;464464+ u64 latest_transid = 0;465465+462466 mutex_lock(&uuid_mutex);463467again:464468 /* This is the initialized path, it is safe to release the devices. */465469 list_for_each_entry_safe(device, next, &fs_devices->devices, dev_list) {466466- if (device->in_fs_metadata)470470+ if (device->in_fs_metadata) {471471+ if (!latest_transid ||472472+ device->generation > latest_transid) {473473+ latest_devid = device->devid;474474+ latest_transid = device->generation;475475+ latest_bdev = device->bdev;476476+ }467477 continue;478478+ }468479469480 if (device->bdev) {470481 blkdev_put(device->bdev, device->mode);···497486 fs_devices = fs_devices->seed;498487 goto again;499488 }489489+490490+ fs_devices->latest_bdev = latest_bdev;491491+ fs_devices->latest_devid = latest_devid;492492+ fs_devices->latest_trans = latest_transid;500493501494 mutex_unlock(&uuid_mutex);502495 return 0;···19681953 em = lookup_extent_mapping(em_tree, chunk_offset, 1);19691954 read_unlock(&em_tree->lock);1970195519711971- BUG_ON(em->start > chunk_offset ||19561956+ BUG_ON(!em || em->start > chunk_offset ||19721957 em->start + em->len < chunk_offset);19731958 map = (struct map_lookup *)em->bdev;19741959···43714356 return -ENOMEM;43724357 btrfs_set_buffer_uptodate(sb);43734358 btrfs_set_buffer_lockdep_class(root->root_key.objectid, sb, 0);43594359+ /*43604360+ * The sb extent buffer is artifical and just used to read the system array.43614361+ * btrfs_set_buffer_uptodate() call does not properly mark all it's43624362+ * pages up-to-date when the page is larger: extent does not cover the43634363+ * whole page and consequently check_page_uptodate does not find all43644364+ * the page's extents up-to-date (the hole beyond sb),43654365+ * write_extent_buffer then triggers a WARN_ON.43664366+ *43674367+ * Regular short extents go through mark_extent_buffer_dirty/writeback cycle,43684368+ * but sb spans only this function. Add an explicit SetPageUptodate call43694369+ * to silence the warning eg. on PowerPC 64.43704370+ */43714371+ if (PAGE_CACHE_SIZE > BTRFS_SUPER_INFO_SIZE)43724372+ SetPageUptodate(sb->first_page);4374437343754374 write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE);43764375 array_size = btrfs_super_sys_array_size(super_copy);
···104104105105static struct hlist_bl_head *dentry_hashtable __read_mostly;106106107107-static inline struct hlist_bl_head *d_hash(struct dentry *parent,107107+static inline struct hlist_bl_head *d_hash(const struct dentry *parent,108108 unsigned long hash)109109{110110 hash += ((unsigned long) parent ^ GOLDEN_RATIO_PRIME) / L1_CACHE_BYTES;···17171717 * child is looked up. Thus, an interlocking stepping of sequence lock checks17181718 * is formed, giving integrity down the path walk.17191719 */17201720-struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name,17211721- unsigned *seq, struct inode **inode)17201720+struct dentry *__d_lookup_rcu(const struct dentry *parent,17211721+ const struct qstr *name,17221722+ unsigned *seqp, struct inode **inode)17221723{17231724 unsigned int len = name->len;17241725 unsigned int hash = name->hash;···17491748 * See Documentation/filesystems/path-lookup.txt for more details.17501749 */17511750 hlist_bl_for_each_entry_rcu(dentry, node, b, d_hash) {17511751+ unsigned seq;17521752 struct inode *i;17531753 const char *tname;17541754 int tlen;···17581756 continue;1759175717601758seqretry:17611761- *seq = read_seqcount_begin(&dentry->d_seq);17591759+ seq = read_seqcount_begin(&dentry->d_seq);17621760 if (dentry->d_parent != parent)17631761 continue;17641762 if (d_unhashed(dentry))···17731771 * edge of memory when walking. If we could load this17741772 * atomically some other way, we could drop this check.17751773 */17761776- if (read_seqcount_retry(&dentry->d_seq, *seq))17741774+ if (read_seqcount_retry(&dentry->d_seq, seq))17771775 goto seqretry;17781776 if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) {17791777 if (parent->d_op->d_compare(parent, *inode,···17901788 * order to do anything useful with the returned dentry17911789 * anyway.17921790 */17911791+ *seqp = seq;17931792 *inode = i;17941793 return dentry;17951794 }···2971296829722969static void __init dcache_init_early(void)29732970{29742974- int loop;29712971+ unsigned int loop;2975297229762973 /* If hashes are distributed across NUMA nodes, defer29772974 * hash allocation until vmalloc space is available.···29892986 &d_hash_mask,29902987 0);2991298829922992- for (loop = 0; loop < (1 << d_hash_shift); loop++)29892989+ for (loop = 0; loop < (1U << d_hash_shift); loop++)29932990 INIT_HLIST_BL_HEAD(dentry_hashtable + loop);29942991}2995299229962993static void __init dcache_init(void)29972994{29982998- int loop;29952995+ unsigned int loop;2999299630002997 /* 30012998 * A constructor could be added for stable state like the lists,···30193016 &d_hash_mask,30203017 0);3021301830223022- for (loop = 0; loop < (1 << d_hash_shift); loop++)30193019+ for (loop = 0; loop < (1U << d_hash_shift); loop++)30233020 INIT_HLIST_BL_HEAD(dentry_hashtable + loop);30243021}30253022
+2-2
fs/direct-io.c
···173173 if (atomic_read(&inode->i_dio_count))174174 __inode_dio_wait(inode);175175}176176-EXPORT_SYMBOL_GPL(inode_dio_wait);176176+EXPORT_SYMBOL(inode_dio_wait);177177178178/*179179 * inode_dio_done - signal finish of a direct I/O requests···187187 if (atomic_dec_and_test(&inode->i_dio_count))188188 wake_up_bit(&inode->i_state, __I_DIO_WAKEUP);189189}190190-EXPORT_SYMBOL_GPL(inode_dio_done);190190+EXPORT_SYMBOL(inode_dio_done);191191192192/*193193 * How many pages are in the queue?
+1-1
fs/ecryptfs/miscdev.c
···429429 goto memdup;430430 } else if (count < MIN_MSG_PKT_SIZE || count > MAX_MSG_PKT_SIZE) {431431 printk(KERN_WARNING "%s: Acceptable packet size range is "432432- "[%d-%lu], but amount of data written is [%zu].",432432+ "[%d-%zu], but amount of data written is [%zu].",433433 __func__, MIN_MSG_PKT_SIZE, MAX_MSG_PKT_SIZE, count);434434 return -EINVAL;435435 }
+29-1
fs/eventpoll.c
···320320 return !list_empty(p);321321}322322323323+static inline struct eppoll_entry *ep_pwq_from_wait(wait_queue_t *p)324324+{325325+ return container_of(p, struct eppoll_entry, wait);326326+}327327+323328/* Get the "struct epitem" from a wait queue pointer */324329static inline struct epitem *ep_item_from_wait(wait_queue_t *p)325330{···472467 put_cpu();473468}474469470470+static void ep_remove_wait_queue(struct eppoll_entry *pwq)471471+{472472+ wait_queue_head_t *whead;473473+474474+ rcu_read_lock();475475+ /* If it is cleared by POLLFREE, it should be rcu-safe */476476+ whead = rcu_dereference(pwq->whead);477477+ if (whead)478478+ remove_wait_queue(whead, &pwq->wait);479479+ rcu_read_unlock();480480+}481481+475482/*476483 * This function unregisters poll callbacks from the associated file477484 * descriptor. Must be called with "mtx" held (or "epmutex" if called from···498481 pwq = list_first_entry(lsthead, struct eppoll_entry, llink);499482500483 list_del(&pwq->llink);501501- remove_wait_queue(pwq->whead, &pwq->wait);484484+ ep_remove_wait_queue(pwq);502485 kmem_cache_free(pwq_cache, pwq);503486 }504487}···858841 unsigned long flags;859842 struct epitem *epi = ep_item_from_wait(wait);860843 struct eventpoll *ep = epi->ep;844844+845845+ if ((unsigned long)key & POLLFREE) {846846+ ep_pwq_from_wait(wait)->whead = NULL;847847+ /*848848+ * whead = NULL above can race with ep_remove_wait_queue()849849+ * which can do another remove_wait_queue() after us, so we850850+ * can't use __remove_wait_queue(). whead->lock is held by851851+ * the caller.852852+ */853853+ list_del_init(&wait->task_list);854854+ }861855862856 spin_lock_irqsave(&ep->lock, flags);863857
···683683 struct gfs2_glock *gl = ip->i_gl;684684 struct gfs2_holder ri_gh;685685 int error = 0;686686+ int unlock_required = 0;686687687688 /* Read new copy from disk if we don't have the latest */688689 if (!sdp->sd_rindex_uptodate) {689690 mutex_lock(&sdp->sd_rindex_mutex);690690- error = gfs2_glock_nq_init(gl, LM_ST_SHARED, 0, &ri_gh);691691- if (error)692692- return error;691691+ if (!gfs2_glock_is_locked_by_me(gl)) {692692+ error = gfs2_glock_nq_init(gl, LM_ST_SHARED, 0, &ri_gh);693693+ if (error)694694+ return error;695695+ unlock_required = 1;696696+ }693697 if (!sdp->sd_rindex_uptodate)694698 error = gfs2_ri_update(ip);695695- gfs2_glock_dq_uninit(&ri_gh);699699+ if (unlock_required)700700+ gfs2_glock_dq_uninit(&ri_gh);696701 mutex_unlock(&sdp->sd_rindex_mutex);697702 }698703
+4-4
fs/inode.c
···16511651 */16521652void __init inode_init_early(void)16531653{16541654- int loop;16541654+ unsigned int loop;1655165516561656 /* If hashes are distributed across NUMA nodes, defer16571657 * hash allocation until vmalloc space is available.···16691669 &i_hash_mask,16701670 0);1671167116721672- for (loop = 0; loop < (1 << i_hash_shift); loop++)16721672+ for (loop = 0; loop < (1U << i_hash_shift); loop++)16731673 INIT_HLIST_HEAD(&inode_hashtable[loop]);16741674}1675167516761676void __init inode_init(void)16771677{16781678- int loop;16781678+ unsigned int loop;1679167916801680 /* inode slab cache */16811681 inode_cachep = kmem_cache_create("inode_cache",···16991699 &i_hash_mask,17001700 0);1701170117021702- for (loop = 0; loop < (1 << i_hash_shift); loop++)17021702+ for (loop = 0; loop < (1U << i_hash_shift); loop++)17031703 INIT_HLIST_HEAD(&inode_hashtable[loop]);17041704}17051705
+47-23
fs/namei.c
···10951095 struct dentry *old;1096109610971097 /* Don't create child dentry for a dead directory. */10981098- if (unlikely(IS_DEADDIR(inode)))10981098+ if (unlikely(IS_DEADDIR(inode))) {10991099+ dput(dentry);10991100 return ERR_PTR(-ENOENT);11011101+ }1100110211011103 old = inode->i_op->lookup(inode, dentry, nd);11021104 if (unlikely(old)) {···13741372 return 1;13751373}1376137413751375+unsigned int full_name_hash(const unsigned char *name, unsigned int len)13761376+{13771377+ unsigned long hash = init_name_hash();13781378+ while (len--)13791379+ hash = partial_name_hash(*name++, hash);13801380+ return end_name_hash(hash);13811381+}13821382+EXPORT_SYMBOL(full_name_hash);13831383+13841384+/*13851385+ * We know there's a real path component here of at least13861386+ * one character.13871387+ */13881388+static inline unsigned long hash_name(const char *name, unsigned int *hashp)13891389+{13901390+ unsigned long hash = init_name_hash();13911391+ unsigned long len = 0, c;13921392+13931393+ c = (unsigned char)*name;13941394+ do {13951395+ len++;13961396+ hash = partial_name_hash(c, hash);13971397+ c = (unsigned char)name[len];13981398+ } while (c && c != '/');13991399+ *hashp = end_name_hash(hash);14001400+ return len;14011401+}14021402+13771403/*13781404 * Name resolution.13791405 * This is the basic name resolution function, turning a pathname into···1422139214231393 /* At this point we know we have a real path component. */14241394 for(;;) {14251425- unsigned long hash;14261395 struct qstr this;14271427- unsigned int c;13961396+ long len;14281397 int type;1429139814301399 err = may_lookup(nd);14311400 if (err)14321401 break;1433140214031403+ len = hash_name(name, &this.hash);14341404 this.name = name;14351435- c = *(const unsigned char *)name;14361436-14371437- hash = init_name_hash();14381438- do {14391439- name++;14401440- hash = partial_name_hash(c, hash);14411441- c = *(const unsigned char *)name;14421442- } while (c && (c != '/'));14431443- this.len = name - (const char *) this.name;14441444- this.hash = end_name_hash(hash);14051405+ this.len = len;1445140614461407 type = LAST_NORM;14471447- if (this.name[0] == '.') switch (this.len) {14081408+ if (name[0] == '.') switch (len) {14481409 case 2:14491449- if (this.name[1] == '.') {14101410+ if (name[1] == '.') {14501411 type = LAST_DOTDOT;14511412 nd->flags |= LOOKUP_JUMPED;14521413 }···14561435 }14571436 }1458143714591459- /* remove trailing slashes? */14601460- if (!c)14381438+ if (!name[len])14611439 goto last_component;14621462- while (*++name == '/');14631463- if (!*name)14401440+ /*14411441+ * If it wasn't NUL, we know it was '/'. Skip that14421442+ * slash, and continue until no more slashes.14431443+ */14441444+ do {14451445+ len++;14461446+ } while (unlikely(name[len] == '/'));14471447+ if (!name[len])14641448 goto last_component;14491449+ name += len;1465145014661451 err = walk_component(nd, &next, &this, type, LOOKUP_FOLLOW);14671452 if (err < 0)···18001773struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)18011774{18021775 struct qstr this;18031803- unsigned long hash;18041776 unsigned int c;1805177718061778 WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex));1807177918081780 this.name = name;18091781 this.len = len;17821782+ this.hash = full_name_hash(name, len);18101783 if (!len)18111784 return ERR_PTR(-EACCES);1812178518131813- hash = init_name_hash();18141786 while (len--) {18151787 c = *(const unsigned char *)name++;18161788 if (c == '/' || c == '\0')18171789 return ERR_PTR(-EACCES);18181818- hash = partial_name_hash(c, hash);18191790 }18201820- this.hash = end_name_hash(hash);18211791 /*18221792 * See if the low-level filesystem might want18231793 * to use its own hash..
+55-75
fs/nfs/nfs4proc.c
···35753575 }35763576 if (npages > 1) {35773577 /* for decoding across pages */35783578- args.acl_scratch = alloc_page(GFP_KERNEL);35793579- if (!args.acl_scratch)35783578+ res.acl_scratch = alloc_page(GFP_KERNEL);35793579+ if (!res.acl_scratch)35803580 goto out_free;35813581 }35823582 args.acl_len = npages * PAGE_SIZE;···36123612 for (i = 0; i < npages; i++)36133613 if (pages[i])36143614 __free_page(pages[i]);36153615- if (args.acl_scratch)36163616- __free_page(args.acl_scratch);36153615+ if (res.acl_scratch)36163616+ __free_page(res.acl_scratch);36173617 return ret;36183618}36193619···48834883 clp->cl_rpcclient->cl_auth->au_flavor);4884488448854885 res.server_scope = kzalloc(sizeof(struct server_scope), GFP_KERNEL);48864886- if (unlikely(!res.server_scope))48874887- return -ENOMEM;48864886+ if (unlikely(!res.server_scope)) {48874887+ status = -ENOMEM;48884888+ goto out;48894889+ }4888489048894891 status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);48904892 if (!status)···49034901 clp->server_scope = NULL;49044902 }4905490349064906- if (!clp->server_scope)49044904+ if (!clp->server_scope) {49074905 clp->server_scope = res.server_scope;49084908- else49094909- kfree(res.server_scope);49064906+ goto out;49074907+ }49104908 }49114911-49094909+ kfree(res.server_scope);49104910+out:49124911 dprintk("<-- %s status= %d\n", __func__, status);49134912 return status;49144913}···50115008 return status;50125009}5013501050115011+static struct nfs4_slot *nfs4_alloc_slots(u32 max_slots, gfp_t gfp_flags)50125012+{50135013+ return kcalloc(max_slots, sizeof(struct nfs4_slot), gfp_flags);50145014+}50155015+50165016+static void nfs4_add_and_init_slots(struct nfs4_slot_table *tbl,50175017+ struct nfs4_slot *new,50185018+ u32 max_slots,50195019+ u32 ivalue)50205020+{50215021+ struct nfs4_slot *old = NULL;50225022+ u32 i;50235023+50245024+ spin_lock(&tbl->slot_tbl_lock);50255025+ if (new) {50265026+ old = tbl->slots;50275027+ tbl->slots = new;50285028+ tbl->max_slots = max_slots;50295029+ }50305030+ tbl->highest_used_slotid = -1; /* no slot is currently used */50315031+ for (i = 0; i < tbl->max_slots; i++)50325032+ tbl->slots[i].seq_nr = ivalue;50335033+ spin_unlock(&tbl->slot_tbl_lock);50345034+ kfree(old);50355035+}50365036+50145037/*50155015- * Reset a slot table50385038+ * (re)Initialise a slot table50165039 */50175017-static int nfs4_reset_slot_table(struct nfs4_slot_table *tbl, u32 max_reqs,50185018- int ivalue)50405040+static int nfs4_realloc_slot_table(struct nfs4_slot_table *tbl, u32 max_reqs,50415041+ u32 ivalue)50195042{50205043 struct nfs4_slot *new = NULL;50215021- int i;50225022- int ret = 0;50445044+ int ret = -ENOMEM;5023504550245046 dprintk("--> %s: max_reqs=%u, tbl->max_slots %d\n", __func__,50255047 max_reqs, tbl->max_slots);5026504850275049 /* Does the newly negotiated max_reqs match the existing slot table? */50285050 if (max_reqs != tbl->max_slots) {50295029- ret = -ENOMEM;50305030- new = kmalloc(max_reqs * sizeof(struct nfs4_slot),50315031- GFP_NOFS);50515051+ new = nfs4_alloc_slots(max_reqs, GFP_NOFS);50325052 if (!new)50335053 goto out;50345034- ret = 0;50355035- kfree(tbl->slots);50365054 }50375037- spin_lock(&tbl->slot_tbl_lock);50385038- if (new) {50395039- tbl->slots = new;50405040- tbl->max_slots = max_reqs;50415041- }50425042- for (i = 0; i < tbl->max_slots; ++i)50435043- tbl->slots[i].seq_nr = ivalue;50445044- spin_unlock(&tbl->slot_tbl_lock);50555055+ ret = 0;50565056+50575057+ nfs4_add_and_init_slots(tbl, new, max_reqs, ivalue);50455058 dprintk("%s: tbl=%p slots=%p max_slots=%d\n", __func__,50465059 tbl, tbl->slots, tbl->max_slots);50475060out:···50805061}5081506250825063/*50835083- * Initialize slot table50845084- */50855085-static int nfs4_init_slot_table(struct nfs4_slot_table *tbl,50865086- int max_slots, int ivalue)50875087-{50885088- struct nfs4_slot *slot;50895089- int ret = -ENOMEM;50905090-50915091- BUG_ON(max_slots > NFS4_MAX_SLOT_TABLE);50925092-50935093- dprintk("--> %s: max_reqs=%u\n", __func__, max_slots);50945094-50955095- slot = kcalloc(max_slots, sizeof(struct nfs4_slot), GFP_NOFS);50965096- if (!slot)50975097- goto out;50985098- ret = 0;50995099-51005100- spin_lock(&tbl->slot_tbl_lock);51015101- tbl->max_slots = max_slots;51025102- tbl->slots = slot;51035103- tbl->highest_used_slotid = -1; /* no slot is currently used */51045104- spin_unlock(&tbl->slot_tbl_lock);51055105- dprintk("%s: tbl=%p slots=%p max_slots=%d\n", __func__,51065106- tbl, tbl->slots, tbl->max_slots);51075107-out:51085108- dprintk("<-- %s: return %d\n", __func__, ret);51095109- return ret;51105110-}51115111-51125112-/*51135064 * Initialize or reset the forechannel and backchannel tables51145065 */51155066static int nfs4_setup_session_slot_tables(struct nfs4_session *ses)···50905101 dprintk("--> %s\n", __func__);50915102 /* Fore channel */50925103 tbl = &ses->fc_slot_table;50935093- if (tbl->slots == NULL) {50945094- status = nfs4_init_slot_table(tbl, ses->fc_attrs.max_reqs, 1);50955095- if (status) /* -ENOMEM */50965096- return status;50975097- } else {50985098- status = nfs4_reset_slot_table(tbl, ses->fc_attrs.max_reqs, 1);50995099- if (status)51005100- return status;51015101- }51045104+ status = nfs4_realloc_slot_table(tbl, ses->fc_attrs.max_reqs, 1);51055105+ if (status) /* -ENOMEM */51065106+ return status;51025107 /* Back channel */51035108 tbl = &ses->bc_slot_table;51045104- if (tbl->slots == NULL) {51055105- status = nfs4_init_slot_table(tbl, ses->bc_attrs.max_reqs, 0);51065106- if (status)51075107- /* Fore and back channel share a connection so get51085108- * both slot tables or neither */51095109- nfs4_destroy_slot_tables(ses);51105110- } else51115111- status = nfs4_reset_slot_table(tbl, ses->bc_attrs.max_reqs, 0);51095109+ status = nfs4_realloc_slot_table(tbl, ses->bc_attrs.max_reqs, 0);51105110+ if (status && tbl->slots == NULL)51115111+ /* Fore and back channel share a connection so get51125112+ * both slot tables or neither */51135113+ nfs4_destroy_slot_tables(ses);51125114 return status;51135115}51145116
···2522252225232523 xdr_inline_pages(&req->rq_rcv_buf, replen << 2,25242524 args->acl_pages, args->acl_pgbase, args->acl_len);25252525- xdr_set_scratch_buffer(xdr, page_address(args->acl_scratch), PAGE_SIZE);2526252525272526 encode_nops(&hdr);25282527}···60316032 struct compound_hdr hdr;60326033 int status;6033603460356035+ if (res->acl_scratch != NULL) {60366036+ void *p = page_address(res->acl_scratch);60376037+ xdr_set_scratch_buffer(xdr, p, PAGE_SIZE);60386038+ }60346039 status = decode_compound_hdr(xdr, &hdr);60356040 if (status)60366041 goto out;
+3-3
fs/ntfs/attrib.c
···11/**22 * attrib.c - NTFS attribute operations. Part of the Linux-NTFS project.33 *44- * Copyright (c) 2001-2007 Anton Altaparmakov44+ * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc.55 * Copyright (c) 2002 Richard Russon66 *77 * This program/include file is free software; you can redistribute it and/or···345345 unsigned long flags;346346 bool is_retry = false;347347348348+ BUG_ON(!ni);348349 ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, %s_locked.",349350 ni->mft_no, (unsigned long long)vcn,350351 write_locked ? "write" : "read");351351- BUG_ON(!ni);352352 BUG_ON(!NInoNonResident(ni));353353 BUG_ON(vcn < 0);354354 if (!ni->runlist.rl) {···469469 int err = 0;470470 bool is_retry = false;471471472472+ BUG_ON(!ni);472473 ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, with%s ctx.",473474 ni->mft_no, (unsigned long long)vcn, ctx ? "" : "out");474474- BUG_ON(!ni);475475 BUG_ON(!NInoNonResident(ni));476476 BUG_ON(vcn < 0);477477 if (!ni->runlist.rl) {
+3-3
fs/ntfs/mft.c
···11/**22 * mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project.33 *44- * Copyright (c) 2001-2011 Anton Altaparmakov and Tuxera Inc.44+ * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc.55 * Copyright (c) 2002 Richard Russon66 *77 * This program/include file is free software; you can redistribute it and/or···13671367 ntfs_error(vol->sb, "Failed to merge runlists for mft "13681368 "bitmap.");13691369 if (ntfs_cluster_free_from_rl(vol, rl2)) {13701370- ntfs_error(vol->sb, "Failed to dealocate "13701370+ ntfs_error(vol->sb, "Failed to deallocate "13711371 "allocated cluster.%s", es);13721372 NVolSetErrors(vol);13731373 }···18051805 ntfs_error(vol->sb, "Failed to merge runlists for mft data "18061806 "attribute.");18071807 if (ntfs_cluster_free_from_rl(vol, rl2)) {18081808- ntfs_error(vol->sb, "Failed to dealocate clusters "18081808+ ntfs_error(vol->sb, "Failed to deallocate clusters "18091809 "from the mft data attribute.%s", es);18101810 NVolSetErrors(vol);18111811 }
+1-3
fs/ntfs/super.c
···11/*22 * super.c - NTFS kernel super block handling. Part of the Linux-NTFS project.33 *44- * Copyright (c) 2001-2011 Anton Altaparmakov and Tuxera Inc.44+ * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc.55 * Copyright (c) 2001,2002 Richard Russon66 *77 * This program/include file is free software; you can redistribute it and/or···12391239{12401240 MFT_REF mref;12411241 struct inode *vi;12421242- ntfs_inode *ni;12431242 struct page *page;12441243 u32 *kaddr, *kend;12451244 ntfs_name *name = NULL;···12891290 "is not the system volume.", i_size_read(vi));12901291 goto iput_out;12911292 }12921292- ni = NTFS_I(vi);12931293 page = ntfs_map_page(vi->i_mapping, 0);12941294 if (IS_ERR(page)) {12951295 ntfs_error(vol->sb, "Failed to read from hiberfil.sys.");
···292292 }293293}294294295295+/* Return 1 if 'cmd' will block on frozen filesystem */296296+static int quotactl_cmd_write(int cmd)297297+{298298+ switch (cmd) {299299+ case Q_GETFMT:300300+ case Q_GETINFO:301301+ case Q_SYNC:302302+ case Q_XGETQSTAT:303303+ case Q_XGETQUOTA:304304+ case Q_XQUOTASYNC:305305+ return 0;306306+ }307307+ return 1;308308+}309309+295310/*296311 * look up a superblock on which quota ops will be performed297312 * - use the name of a block device to find the superblock thereon298313 */299299-static struct super_block *quotactl_block(const char __user *special)314314+static struct super_block *quotactl_block(const char __user *special, int cmd)300315{301316#ifdef CONFIG_BLOCK302317 struct block_device *bdev;···324309 putname(tmp);325310 if (IS_ERR(bdev))326311 return ERR_CAST(bdev);327327- sb = get_super(bdev);312312+ if (quotactl_cmd_write(cmd))313313+ sb = get_super_thawed(bdev);314314+ else315315+ sb = get_super(bdev);328316 bdput(bdev);329317 if (!sb)330318 return ERR_PTR(-ENODEV);···379361 pathp = &path;380362 }381363382382- sb = quotactl_block(special);364364+ sb = quotactl_block(special, cmds);383365 if (IS_ERR(sb)) {384366 ret = PTR_ERR(sb);385367 goto out;
···3030#include <linux/signalfd.h>3131#include <linux/syscalls.h>32323333+void signalfd_cleanup(struct sighand_struct *sighand)3434+{3535+ wait_queue_head_t *wqh = &sighand->signalfd_wqh;3636+ /*3737+ * The lockless check can race with remove_wait_queue() in progress,3838+ * but in this case its caller should run under rcu_read_lock() and3939+ * sighand_cachep is SLAB_DESTROY_BY_RCU, we can safely return.4040+ */4141+ if (likely(!waitqueue_active(wqh)))4242+ return;4343+4444+ /* wait_queue_t->func(POLLFREE) should do remove_wait_queue() */4545+ wake_up_poll(wqh, POLLHUP | POLLFREE);4646+}4747+3348struct signalfd_ctx {3449 sigset_t sigmask;3550};
+22
fs/super.c
···634634EXPORT_SYMBOL(get_super);635635636636/**637637+ * get_super_thawed - get thawed superblock of a device638638+ * @bdev: device to get the superblock for639639+ *640640+ * Scans the superblock list and finds the superblock of the file system641641+ * mounted on the device. The superblock is returned once it is thawed642642+ * (or immediately if it was not frozen). %NULL is returned if no match643643+ * is found.644644+ */645645+struct super_block *get_super_thawed(struct block_device *bdev)646646+{647647+ while (1) {648648+ struct super_block *s = get_super(bdev);649649+ if (!s || s->s_frozen == SB_UNFROZEN)650650+ return s;651651+ up_read(&s->s_umount);652652+ vfs_check_frozen(s, SB_FREEZE_WRITE);653653+ put_super(s);654654+ }655655+}656656+EXPORT_SYMBOL(get_super_thawed);657657+658658+/**637659 * get_active_super - get an active reference to the superblock of a device638660 * @bdev: device to get the superblock for639661 *
···7070/* Destroy a virtual mapping cookie for a PCI BAR (memory or IO) */7171struct pci_dev;7272extern void pci_iounmap(struct pci_dev *dev, void __iomem *);7373-#else7373+#elif defined(CONFIG_GENERIC_IOMAP)7474struct pci_dev;7575static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)7676{ }
+1-1
include/asm-generic/pci_iomap.h
···2525#define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr))2626#endif27272828-#else2828+#elif defined(CONFIG_GENERIC_PCI_IOMAP)2929static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)3030{3131 return NULL;
+2
include/asm-generic/poll.h
···2828#define POLLRDHUP 0x20002929#endif30303131+#define POLLFREE 0x4000 /* currently only for epoll */3232+3133struct pollfd {3234 int fd;3335 short events;
···137137 IFLA_AF_SPEC,138138 IFLA_GROUP, /* Group the device belongs to */139139 IFLA_NET_NS_FD,140140+ IFLA_EXT_MASK, /* Extended info mask, VFs, etc */140141 __IFLA_MAX141142};142143
···602602#define TCA_ACT_TAB 1 /* attr type must be >=1 */ 603603#define TCAA_MAX 1604604605605+/* New extended info filters for IFLA_EXT_MASK */606606+#define RTEXT_FILTER_VF (1 << 0)607607+605608/* End of information exported to user level */606609607610#ifdef __KERNEL__
···624624asmlinkage long sys_socketcall(int call, unsigned long __user *args);625625asmlinkage long sys_listen(int, int);626626asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,627627- long timeout);627627+ int timeout);628628asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,629629 fd_set __user *exp, struct timeval __user *tvp);630630asmlinkage long sys_old_select(struct sel_arg_struct __user *arg);
···651651652652 err_alloc:653653 for_each_possible_cpu(err_cpu) {654654- if (err_cpu == cpu)655655- break;656654 for (i = 0; i < TYPE_MAX; i++)657655 kfree(per_cpu(nr_task_bp_pinned[i], cpu));656656+ if (err_cpu == cpu)657657+ break;658658 }659659660660 return -ENOMEM;
+4-1
kernel/fork.c
···6666#include <linux/user-return-notifier.h>6767#include <linux/oom.h>6868#include <linux/khugepaged.h>6969+#include <linux/signalfd.h>69707071#include <asm/pgtable.h>7172#include <asm/pgalloc.h>···936935937936void __cleanup_sighand(struct sighand_struct *sighand)938937{939939- if (atomic_dec_and_test(&sighand->count))938938+ if (atomic_dec_and_test(&sighand->count)) {939939+ signalfd_cleanup(sighand);940940 kmem_cache_free(sighand_cachep, sighand);941941+ }941942}942943943944
+2-2
kernel/irq/autoprobe.c
···5353 if (desc->irq_data.chip->irq_set_type)5454 desc->irq_data.chip->irq_set_type(&desc->irq_data,5555 IRQ_TYPE_PROBE);5656- irq_startup(desc);5656+ irq_startup(desc, false);5757 }5858 raw_spin_unlock_irq(&desc->lock);5959 }···7070 raw_spin_lock_irq(&desc->lock);7171 if (!desc->action && irq_settings_can_probe(desc)) {7272 desc->istate |= IRQS_AUTODETECT | IRQS_WAITING;7373- if (irq_startup(desc))7373+ if (irq_startup(desc, false))7474 desc->istate |= IRQS_PENDING;7575 }7676 raw_spin_unlock_irq(&desc->lock);
+33-9
kernel/irq/chip.c
···157157 irqd_set(&desc->irq_data, IRQD_IRQ_MASKED);158158}159159160160-int irq_startup(struct irq_desc *desc)160160+int irq_startup(struct irq_desc *desc, bool resend)161161{162162+ int ret = 0;163163+162164 irq_state_clr_disabled(desc);163165 desc->depth = 0;164166165167 if (desc->irq_data.chip->irq_startup) {166166- int ret = desc->irq_data.chip->irq_startup(&desc->irq_data);168168+ ret = desc->irq_data.chip->irq_startup(&desc->irq_data);167169 irq_state_clr_masked(desc);168168- return ret;170170+ } else {171171+ irq_enable(desc);169172 }170170-171171- irq_enable(desc);172172- return 0;173173+ if (resend)174174+ check_irq_resend(desc, desc->irq_data.irq);175175+ return ret;173176}174177175178void irq_shutdown(struct irq_desc *desc)···333330}334331EXPORT_SYMBOL_GPL(handle_simple_irq);335332333333+/*334334+ * Called unconditionally from handle_level_irq() and only for oneshot335335+ * interrupts from handle_fasteoi_irq()336336+ */337337+static void cond_unmask_irq(struct irq_desc *desc)338338+{339339+ /*340340+ * We need to unmask in the following cases:341341+ * - Standard level irq (IRQF_ONESHOT is not set)342342+ * - Oneshot irq which did not wake the thread (caused by a343343+ * spurious interrupt or a primary handler handling it344344+ * completely).345345+ */346346+ if (!irqd_irq_disabled(&desc->irq_data) &&347347+ irqd_irq_masked(&desc->irq_data) && !desc->threads_oneshot)348348+ unmask_irq(desc);349349+}350350+336351/**337352 * handle_level_irq - Level type irq handler338353 * @irq: the interrupt number···383362384363 handle_irq_event(desc);385364386386- if (!irqd_irq_disabled(&desc->irq_data) && !(desc->istate & IRQS_ONESHOT))387387- unmask_irq(desc);365365+ cond_unmask_irq(desc);366366+388367out_unlock:389368 raw_spin_unlock(&desc->lock);390369}···437416438417 preflow_handler(desc);439418 handle_irq_event(desc);419419+420420+ if (desc->istate & IRQS_ONESHOT)421421+ cond_unmask_irq(desc);440422441423out_eoi:442424 desc->irq_data.chip->irq_eoi(&desc->irq_data);···649625 irq_settings_set_noprobe(desc);650626 irq_settings_set_norequest(desc);651627 irq_settings_set_nothread(desc);652652- irq_startup(desc);628628+ irq_startup(desc, true);653629 }654630out:655631 irq_put_desc_busunlock(desc, flags);
···696696 if (vma->vm_file) {697697 mapping = vma->vm_file->f_mapping;698698699699+ mutex_lock(&mapping->i_mmap_mutex);699700 flush_dcache_mmap_lock(mapping);700701 vma_prio_tree_insert(vma, &mapping->i_mmap);701702 flush_dcache_mmap_unlock(mapping);703703+ mutex_unlock(&mapping->i_mmap_mutex);702704 }703705704706 /* add the VMA to the tree */···762760 if (vma->vm_file) {763761 mapping = vma->vm_file->f_mapping;764762763763+ mutex_lock(&mapping->i_mmap_mutex);765764 flush_dcache_mmap_lock(mapping);766765 vma_prio_tree_remove(vma, &mapping->i_mmap);767766 flush_dcache_mmap_unlock(mapping);767767+ mutex_unlock(&mapping->i_mmap_mutex);768768 }769769770770 /* remove from the MM's tree and list */···779775780776 if (vma->vm_next)781777 vma->vm_next->vm_prev = vma->vm_prev;782782-783783- vma->vm_mm = NULL;784778}785779786780/*···20542052 high = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;2055205320562054 down_write(&nommu_region_sem);20552055+ mutex_lock(&inode->i_mapping->i_mmap_mutex);2057205620582057 /* search for VMAs that fall within the dead zone */20592058 vma_prio_tree_foreach(vma, &iter, &inode->i_mapping->i_mmap,···20622059 /* found one - only interested if it's shared out of the page20632060 * cache */20642061 if (vma->vm_flags & VM_SHARED) {20622062+ mutex_unlock(&inode->i_mapping->i_mmap_mutex);20652063 up_write(&nommu_region_sem);20662064 return -ETXTBSY; /* not quite true, but near enough */20672065 }···20902086 }20912087 }2092208820892089+ mutex_unlock(&inode->i_mapping->i_mmap_mutex);20932090 up_write(&nommu_region_sem);20942091 return 0;20952092}
+1
mm/page_alloc.c
···52365236 max = ((unsigned long long)nr_all_pages << PAGE_SHIFT) >> 4;52375237 do_div(max, bucketsize);52385238 }52395239+ max = min(max, 0x80000000ULL);5239524052405241 if (numentries > max)52415242 numentries = max;
···7171 "slock-AF_BLUETOOTH-BTPROTO_AVDTP",7272};73737474-static inline void bt_sock_reclassify_lock(struct socket *sock, int proto)7474+void bt_sock_reclassify_lock(struct sock *sk, int proto)7575{7676- struct sock *sk = sock->sk;7777-7878- if (!sk)7979- return;8080-7676+ BUG_ON(!sk);8177 BUG_ON(sock_owned_by_user(sk));82788379 sock_lock_init_class_and_name(sk,8480 bt_slock_key_strings[proto], &bt_slock_key[proto],8581 bt_key_strings[proto], &bt_lock_key[proto]);8682}8383+EXPORT_SYMBOL(bt_sock_reclassify_lock);87848885int bt_sock_register(int proto, const struct net_proto_family *ops)8986{···142145143146 if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) {144147 err = bt_proto[proto]->create(net, sock, proto, kern);145145- bt_sock_reclassify_lock(sock, proto);148148+ if (!err)149149+ bt_sock_reclassify_lock(sock->sk, proto);146150 module_put(bt_proto[proto]->owner);147151 }148152
+4
net/bluetooth/hci_conn.c
···635635636636 if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {637637 struct hci_cp_auth_requested cp;638638+639639+ /* encrypt must be pending if auth is also pending */640640+ set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend);641641+638642 cp.handle = cpu_to_le16(conn->handle);639643 hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,640644 sizeof(cp), &cp);
···11641164 break;1165116511661166 case BT_DISCONN:11671167- /* When socket is closed and we are not RFCOMM11681168- * initiator rfcomm_process_rx already calls11691169- * rfcomm_session_put() */11701170- if (s->sock->sk->sk_state != BT_CLOSED)11711171- if (list_empty(&s->dlcs))11721172- rfcomm_session_put(s);11671167+ /* rfcomm_session_put is called later so don't do11681168+ * anything here otherwise we will mess up the session11691169+ * reference counter:11701170+ *11711171+ * (a) when we are the initiator dlc_unlink will drive11721172+ * the reference counter to 0 (there is no initial put11731173+ * after session_add)11741174+ *11751175+ * (b) when we are not the initiator rfcomm_rx_process11761176+ * will explicitly call put to balance the initial hold11771177+ * done after session add.11781178+ */11731179 break;11741180 }11751181 }
···826826 write_unlock_bh(&tbl->lock);827827 cond_resched();828828 write_lock_bh(&tbl->lock);829829+ nht = rcu_dereference_protected(tbl->nht,830830+ lockdep_is_held(&tbl->lock));829831 }830832 /* Cycle through all hash buckets every base_reachable_time/2 ticks.831833 * ARP entry timeouts range from 1/2 base_reachable_time to 3/2
···6565 it is infeasible task. The most general solutions would be6666 to keep skb->encapsulation counter (sort of local ttl),6767 and silently drop packet when it expires. It is a good6868- solution, but it supposes maintaing new variable in ALL6868+ solution, but it supposes maintaining new variable in ALL6969 skb, even if no tunneling is used.70707171 Current solution: xmit_recursion breaks dead loops. This is a percpu···91919292 One of them is to parse packet trying to detect inner encapsulation9393 made by our node. It is difficult or even impossible, especially,9494- taking into account fragmentation. TO be short, tt is not solution at all.9494+ taking into account fragmentation. TO be short, ttl is not solution at all.95959696 Current solution: The solution was UNEXPECTEDLY SIMPLE.9797 We force DF flag on tunnels with preconfigured hop limit,9898 that is ALL. :-) Well, it does not remove the problem completely,9999 but exponential growth of network traffic is changed to linear100100 (branches, that exceed pmtu are pruned) and tunnel mtu101101- fastly degrades to value <68, where looping stops.101101+ rapidly degrades to value <68, where looping stops.102102 Yes, it is not good if there exists a router in the loop,103103 which does not force DF, even when encapsulating packets have DF set.104104 But it is not our problem! Nobody could accuse us, we made···457457 GRE tunnels with enabled checksum. Tell them "thank you".458458459459 Well, I wonder, rfc1812 was written by Cisco employee,460460- what the hell these idiots break standrads established461461- by themself???460460+ what the hell these idiots break standards established461461+ by themselves???462462 */463463464464 const struct iphdr *iph = (const struct iphdr *)skb->data;
···5252 * @WLAN_STA_SP: Station is in a service period, so don't try to5353 * reply to other uAPSD trigger frames or PS-Poll.5454 * @WLAN_STA_4ADDR_EVENT: 4-addr event was already sent for this frame.5555+ * @WLAN_STA_RATE_CONTROL: rate control was initialized for this station.5556 */5657enum ieee80211_sta_info_flags {5758 WLAN_STA_AUTH,···7271 WLAN_STA_UAPSD,7372 WLAN_STA_SP,7473 WLAN_STA_4ADDR_EVENT,7474+ WLAN_STA_RATE_CONTROL,7575};76767777enum ieee80211_sta_state {
+1-1
net/netfilter/ipvs/ip_vs_core.c
···232232 __be16 dport = 0; /* destination port to forward */233233 unsigned int flags;234234 struct ip_vs_conn_param param;235235+ const union nf_inet_addr fwmark = { .ip = htonl(svc->fwmark) };235236 union nf_inet_addr snet; /* source network of the client,236237 after masking */237238···268267 {269268 int protocol = iph.protocol;270269 const union nf_inet_addr *vaddr = &iph.daddr;271271- const union nf_inet_addr fwmark = { .ip = htonl(svc->fwmark) };272270 __be16 vport = 0;273271274272 if (dst_port == svc->port) {
+34-4
net/netfilter/nf_conntrack_core.c
···404404 &net->ct.hash[repl_hash]);405405}406406407407-void nf_conntrack_hash_insert(struct nf_conn *ct)407407+int408408+nf_conntrack_hash_check_insert(struct nf_conn *ct)408409{409410 struct net *net = nf_ct_net(ct);410411 unsigned int hash, repl_hash;412412+ struct nf_conntrack_tuple_hash *h;413413+ struct hlist_nulls_node *n;411414 u16 zone;412415413416 zone = nf_ct_zone(ct);414414- hash = hash_conntrack(net, zone, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);415415- repl_hash = hash_conntrack(net, zone, &ct->tuplehash[IP_CT_DIR_REPLY].tuple);417417+ hash = hash_conntrack(net, zone,418418+ &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);419419+ repl_hash = hash_conntrack(net, zone,420420+ &ct->tuplehash[IP_CT_DIR_REPLY].tuple);416421422422+ spin_lock_bh(&nf_conntrack_lock);423423+424424+ /* See if there's one in the list already, including reverse */425425+ hlist_nulls_for_each_entry(h, n, &net->ct.hash[hash], hnnode)426426+ if (nf_ct_tuple_equal(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,427427+ &h->tuple) &&428428+ zone == nf_ct_zone(nf_ct_tuplehash_to_ctrack(h)))429429+ goto out;430430+ hlist_nulls_for_each_entry(h, n, &net->ct.hash[repl_hash], hnnode)431431+ if (nf_ct_tuple_equal(&ct->tuplehash[IP_CT_DIR_REPLY].tuple,432432+ &h->tuple) &&433433+ zone == nf_ct_zone(nf_ct_tuplehash_to_ctrack(h)))434434+ goto out;435435+436436+ add_timer(&ct->timeout);437437+ nf_conntrack_get(&ct->ct_general);417438 __nf_conntrack_hash_insert(ct, hash, repl_hash);439439+ NF_CT_STAT_INC(net, insert);440440+ spin_unlock_bh(&nf_conntrack_lock);441441+442442+ return 0;443443+444444+out:445445+ NF_CT_STAT_INC(net, insert_failed);446446+ spin_unlock_bh(&nf_conntrack_lock);447447+ return -EEXIST;418448}419419-EXPORT_SYMBOL_GPL(nf_conntrack_hash_insert);449449+EXPORT_SYMBOL_GPL(nf_conntrack_hash_check_insert);420450421451/* Confirm a connection given skb; places it in hash table */422452int
+16-30
net/netfilter/nf_conntrack_netlink.c
···13671367 nf_ct_protonum(ct));13681368 if (helper == NULL) {13691369 rcu_read_unlock();13701370- spin_unlock_bh(&nf_conntrack_lock);13711370#ifdef CONFIG_MODULES13721371 if (request_module("nfct-helper-%s", helpname) < 0) {13731373- spin_lock_bh(&nf_conntrack_lock);13741372 err = -EOPNOTSUPP;13751373 goto err1;13761374 }1377137513781378- spin_lock_bh(&nf_conntrack_lock);13791376 rcu_read_lock();13801377 helper = __nf_conntrack_helper_find(helpname,13811378 nf_ct_l3num(ct),···14651468 if (tstamp)14661469 tstamp->start = ktime_to_ns(ktime_get_real());1467147014681468- add_timer(&ct->timeout);14691469- nf_conntrack_hash_insert(ct);14711471+ err = nf_conntrack_hash_check_insert(ct);14721472+ if (err < 0)14731473+ goto err2;14741474+14701475 rcu_read_unlock();1471147614721477 return ct;···14891490 struct nf_conntrack_tuple otuple, rtuple;14901491 struct nf_conntrack_tuple_hash *h = NULL;14911492 struct nfgenmsg *nfmsg = nlmsg_data(nlh);14931493+ struct nf_conn *ct;14921494 u_int8_t u3 = nfmsg->nfgen_family;14931495 u16 zone;14941496 int err;···15101510 return err;15111511 }1512151215131513- spin_lock_bh(&nf_conntrack_lock);15141513 if (cda[CTA_TUPLE_ORIG])15151515- h = __nf_conntrack_find(net, zone, &otuple);15141514+ h = nf_conntrack_find_get(net, zone, &otuple);15161515 else if (cda[CTA_TUPLE_REPLY])15171517- h = __nf_conntrack_find(net, zone, &rtuple);15161516+ h = nf_conntrack_find_get(net, zone, &rtuple);1518151715191518 if (h == NULL) {15201519 err = -ENOENT;15211520 if (nlh->nlmsg_flags & NLM_F_CREATE) {15221522- struct nf_conn *ct;15231521 enum ip_conntrack_events events;1524152215251523 ct = ctnetlink_create_conntrack(net, zone, cda, &otuple,15261524 &rtuple, u3);15271527- if (IS_ERR(ct)) {15281528- err = PTR_ERR(ct);15291529- goto out_unlock;15301530- }15251525+ if (IS_ERR(ct))15261526+ return PTR_ERR(ct);15271527+15311528 err = 0;15321532- nf_conntrack_get(&ct->ct_general);15331533- spin_unlock_bh(&nf_conntrack_lock);15341529 if (test_bit(IPS_EXPECTED_BIT, &ct->status))15351530 events = IPCT_RELATED;15361531 else···15401545 ct, NETLINK_CB(skb).pid,15411546 nlmsg_report(nlh));15421547 nf_ct_put(ct);15431543- } else15441544- spin_unlock_bh(&nf_conntrack_lock);15481548+ }1545154915461550 return err;15471551 }15481552 /* implicit 'else' */1549155315501550- /* We manipulate the conntrack inside the global conntrack table lock,15511551- * so there's no need to increase the refcount */15521554 err = -EEXIST;15551555+ ct = nf_ct_tuplehash_to_ctrack(h);15531556 if (!(nlh->nlmsg_flags & NLM_F_EXCL)) {15541554- struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(h);15551555-15571557+ spin_lock_bh(&nf_conntrack_lock);15561558 err = ctnetlink_change_conntrack(ct, cda);15591559+ spin_unlock_bh(&nf_conntrack_lock);15571560 if (err == 0) {15581558- nf_conntrack_get(&ct->ct_general);15591559- spin_unlock_bh(&nf_conntrack_lock);15601561 nf_conntrack_eventmask_report((1 << IPCT_REPLY) |15611562 (1 << IPCT_ASSURED) |15621563 (1 << IPCT_HELPER) |···15611570 (1 << IPCT_MARK),15621571 ct, NETLINK_CB(skb).pid,15631572 nlmsg_report(nlh));15641564- nf_ct_put(ct);15651565- } else15661566- spin_unlock_bh(&nf_conntrack_lock);15671567-15681568- return err;15731573+ }15691574 }1570157515711571-out_unlock:15721572- spin_unlock_bh(&nf_conntrack_lock);15761576+ nf_ct_put(ct);15731577 return err;15741578}15751579
+32-8
net/netfilter/nf_queue.c
···203203 return status;204204}205205206206+#ifdef CONFIG_BRIDGE_NETFILTER207207+/* When called from bridge netfilter, skb->data must point to MAC header208208+ * before calling skb_gso_segment(). Else, original MAC header is lost209209+ * and segmented skbs will be sent to wrong destination.210210+ */211211+static void nf_bridge_adjust_skb_data(struct sk_buff *skb)212212+{213213+ if (skb->nf_bridge)214214+ __skb_push(skb, skb->network_header - skb->mac_header);215215+}216216+217217+static void nf_bridge_adjust_segmented_data(struct sk_buff *skb)218218+{219219+ if (skb->nf_bridge)220220+ __skb_pull(skb, skb->network_header - skb->mac_header);221221+}222222+#else223223+#define nf_bridge_adjust_skb_data(s) do {} while (0)224224+#define nf_bridge_adjust_segmented_data(s) do {} while (0)225225+#endif226226+206227int nf_queue(struct sk_buff *skb,207228 struct list_head *elem,208229 u_int8_t pf, unsigned int hook,···233212 unsigned int queuenum)234213{235214 struct sk_buff *segs;236236- int err;215215+ int err = -EINVAL;237216 unsigned int queued;238217239218 if (!skb_is_gso(skb))···249228 break;250229 }251230231231+ nf_bridge_adjust_skb_data(skb);252232 segs = skb_gso_segment(skb, 0);253233 /* Does not use PTR_ERR to limit the number of error codes that can be254234 * returned by nf_queue. For instance, callers rely on -ECANCELED to mean255235 * 'ignore this hook'.256236 */257237 if (IS_ERR(segs))258258- return -EINVAL;259259-238238+ goto out_err;260239 queued = 0;261240 err = 0;262241 do {263242 struct sk_buff *nskb = segs->next;264243265244 segs->next = NULL;266266- if (err == 0)245245+ if (err == 0) {246246+ nf_bridge_adjust_segmented_data(segs);267247 err = __nf_queue(segs, elem, pf, hook, indev,268248 outdev, okfn, queuenum);249249+ }269250 if (err == 0)270251 queued++;271252 else···275252 segs = nskb;276253 } while (segs);277254278278- /* also free orig skb if only some segments were queued */279279- if (unlikely(err && queued))280280- err = 0;281281- if (err == 0)255255+ if (queued) {282256 kfree_skb(skb);257257+ return 0;258258+ }259259+ out_err:260260+ nf_bridge_adjust_segmented_data(skb);283261 return err;284262}285263
···501501502502 /* if more time remaining? */503503 if (cb->time_to_send <= psched_get_time()) {504504- skb = qdisc_dequeue_tail(sch);505505- if (unlikely(!skb))506506- goto qdisc_dequeue;504504+ __skb_unlink(skb, &sch->q);505505+ sch->qstats.backlog -= qdisc_pkt_len(skb);507506508507#ifdef CONFIG_NET_CLS_ACT509508 /*···538539 qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send);539540 }540541541541-qdisc_dequeue:542542 if (q->qdisc) {543543 skb = q->qdisc->ops->dequeue(q->qdisc);544544 if (skb)
+4-9
scripts/coccicheck
···99# FLAGS="-ignore_unknown_options -very_quiet"1010# OPTIONS=$*11111212- if [ "$KBUILD_EXTMOD" = "" ] ; then1313- # Workaround for Coccinelle < 0.2.31414- FLAGS="-I $srctree/include -very_quiet"1515- shift $(( $# - 1 ))1616- OPTIONS=$11717- else1818- echo M= is not currently supported when C=1 or C=21919- exit 12020- fi1212+# Workaround for Coccinelle < 0.2.31313+ FLAGS="-I $srctree/include -very_quiet"1414+ shift $(( $# - 1 ))1515+ OPTIONS=$12116else2217 ONLINE=02318 FLAGS="-very_quiet"
-6
scripts/depmod.sh
···99DEPMOD=$11010KERNELRELEASE=$211111212-if ! "$DEPMOD" -V 2>/dev/null | grep -q module-init-tools; then1313- echo "Warning: you may need to install module-init-tools" >&21414- echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt" >&21515- sleep 11616-fi1717-1812if ! test -r System.map -a -x "$DEPMOD"; then1913 exit 02014fi
+31-4
scripts/mod/file2alias.c
···4646 void *function;4747};48484949+#define ___cat(a,b) a ## b5050+#define __cat(a,b) ___cat(a,b)5151+5252+/* we need some special handling for this host tool running eventually on5353+ * Darwin. The Mach-O section handling is a bit different than ELF section5454+ * handling. The differnces in detail are:5555+ * a) we have segments which have sections5656+ * b) we need a API call to get the respective section symbols */5757+#if defined(__MACH__)5858+#include <mach-o/getsect.h>5959+6060+#define INIT_SECTION(name) do { \6161+ unsigned long name ## _len; \6262+ char *__cat(pstart_,name) = getsectdata("__TEXT", \6363+ #name, &__cat(name,_len)); \6464+ char *__cat(pstop_,name) = __cat(pstart_,name) + \6565+ __cat(name, _len); \6666+ __cat(__start_,name) = (void *)__cat(pstart_,name); \6767+ __cat(__stop_,name) = (void *)__cat(pstop_,name); \6868+ } while (0)6969+#define SECTION(name) __attribute__((section("__TEXT, " #name)))7070+7171+struct devtable **__start___devtable, **__stop___devtable;7272+#else7373+#define INIT_SECTION(name) /* no-op for ELF */7474+#define SECTION(name) __attribute__((section(#name)))7575+4976/* We construct a table of pointers in an ELF section (pointers generally5077 * go unpadded by gcc). ld creates boundary syms for us. */5178extern struct devtable *__start___devtable[], *__stop___devtable[];5252-#define ___cat(a,b) a ## b5353-#define __cat(a,b) ___cat(a,b)7979+#endif /* __MACH__ */54805581#if __GNUC__ == 3 && __GNUC_MINOR__ < 35682# define __used __attribute__((__unused__))···9165 (type *)NULL, \9266 (char *)NULL)), \9367 sizeof(type), (function) }; \9494- static struct devtable *__attribute__((section("__devtable"))) \9595- __used __cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__)6868+ static struct devtable *SECTION(__devtable) __used \6969+ __cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__)96709771#define ADD(str, sep, cond, field) \9872do { \···11061080 do_pnp_card_entries(symval, sym->st_size, mod);11071081 else {11081082 struct devtable **p;10831083+ INIT_SECTION(__devtable);1109108411101085 for (p = __start___devtable; p < __stop___devtable; p++) {11111086 if (sym_is(name, namelen, (*p)->device_id)) {
+9
scripts/mod/modpost.c
···14941494 return 0;14951495}1496149614971497+#ifndef R_ARM_CALL14981498+#define R_ARM_CALL 2814991499+#endif15001500+#ifndef R_ARM_JUMP2415011501+#define R_ARM_JUMP24 2915021502+#endif15031503+14971504static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)14981505{14991506 unsigned int r_typ = ELF_R_TYPE(r->r_info);···15121505 (elf->symtab_start + ELF_R_SYM(r->r_info));15131506 break;15141507 case R_ARM_PC24:15081508+ case R_ARM_CALL:15091509+ case R_ARM_JUMP24:15151510 /* From ARM ABI: ((S + A) | T) - P */15161511 r->r_addend = (int)(long)(elf->hdr +15171512 sechdr->sh_offset +
+6-6
scripts/package/builddeb
···238238fi239239240240# Build header package241241-(cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$)242242-(cd $srctree; find arch/$SRCARCH/include include scripts -type f >> /tmp/files$$)243243-(cd $objtree; find .config Module.symvers include scripts -type f >> /tmp/objfiles$$)241241+(cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles")242242+(cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles")243243+(cd $objtree; find .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")244244destdir=$kernel_headers_dir/usr/src/linux-headers-$version245245mkdir -p "$destdir"246246-(cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -)247247-(cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -)248248-rm -f /tmp/files$$ /tmp/objfiles$$246246+(cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -)247247+(cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -)248248+rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"249249arch=$(dpkg --print-architecture)250250251251cat <<EOF >> debian/control
···46294629 unsigned int val = AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN;46304630 if (no_hp_sensing(spec, i))46314631 continue;46324632- if (presence)46324632+ if (1 /*presence*/)46334633 stac92xx_set_pinctl(codec, cfg->hp_pins[i], val);46344634#if 0 /* FIXME */46354635/* Resetting the pinctl like below may lead to (a sort of) regressions
···112112 break;113113 case SND_SOC_DAIFMT_DSP_A:114114 /* data on rising edge of bclk, frame high 1clk before data */115115- strcr |= SSI_STCR_TFSL | SSI_STCR_TEFS;115115+ strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0 | SSI_STCR_TEFS;116116 break;117117 }118118
···11#ifndef __USBAUDIO_CARD_H22#define __USBAUDIO_CARD_H3344+#define MAX_NR_RATES 102445#define MAX_PACKS 2056#define MAX_PACKS_HS (MAX_PACKS * 8) /* in high speed mode */67#define MAX_URBS 8
+1-3
sound/usb/format.c
···209209 return 0;210210}211211212212-#define MAX_UAC2_NR_RATES 1024213213-214212/*215213 * Helper function to walk the array of sample rate triplets reported by216214 * the device. The problem is that we need to parse whole array first to···253255 fp->rates |= snd_pcm_rate_to_rate_bit(rate);254256255257 nr_rates++;256256- if (nr_rates >= MAX_UAC2_NR_RATES) {258258+ if (nr_rates >= MAX_NR_RATES) {257259 snd_printk(KERN_ERR "invalid uac2 rates\n");258260 break;259261 }
+5-1
sound/usb/quirks.c
···132132 unsigned *rate_table = NULL;133133134134 fp = kmemdup(quirk->data, sizeof(*fp), GFP_KERNEL);135135- if (! fp) {135135+ if (!fp) {136136 snd_printk(KERN_ERR "cannot memdup\n");137137 return -ENOMEM;138138+ }139139+ if (fp->nr_rates > MAX_NR_RATES) {140140+ kfree(fp);141141+ return -EINVAL;138142 }139143 if (fp->nr_rates > 0) {140144 rate_table = kmemdup(fp->rate_table,
···349349 hlist_for_each_entry(sid, pos, head, node)350350 if (sid->id == id)351351 return sid->evsel;352352+353353+ if (!perf_evlist__sample_id_all(evlist))354354+ return list_entry(evlist->entries.next, struct perf_evsel, node);355355+352356 return NULL;353357}354358
+6
tools/perf/util/probe-event.c
···18671867 tev->point.symbol);18681868 ret = -ENOENT;18691869 goto error;18701870+ } else if (tev->point.offset > sym->end - sym->start) {18711871+ pr_warning("Offset specified is greater than size of %s\n",18721872+ tev->point.symbol);18731873+ ret = -ENOENT;18741874+ goto error;18751875+18701876 }1871187718721878 return 1;
+11-1
tools/perf/util/probe-finder.c
···672672static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr,673673 bool retprobe, struct probe_trace_point *tp)674674{675675- Dwarf_Addr eaddr;675675+ Dwarf_Addr eaddr, highaddr;676676 const char *name;677677678678 /* Copy the name of probe point */···682682 pr_warning("Failed to get entry address of %s\n",683683 dwarf_diename(sp_die));684684 return -ENOENT;685685+ }686686+ if (dwarf_highpc(sp_die, &highaddr) != 0) {687687+ pr_warning("Failed to get end address of %s\n",688688+ dwarf_diename(sp_die));689689+ return -ENOENT;690690+ }691691+ if (paddr > highaddr) {692692+ pr_warning("Offset specified is greater than size of %s\n",693693+ dwarf_diename(sp_die));694694+ return -EINVAL;685695 }686696 tp->symbol = strdup(name);687697 if (tp->symbol == NULL)
+5-3
tools/testing/ktest/ktest.pl
···32443244 $in_bisect = 1;3245324532463246 my $failed = 0;32473247- build "oldconfig";32483248- start_monitor_and_boot or $failed = 1;32493249- end_monitor;32473247+ build "oldconfig" or $failed = 1;32483248+ if (!$failed) {32493249+ start_monitor_and_boot or $failed = 1;32503250+ end_monitor;32513251+ }3250325232513253 $in_bisect = 0;32523254