···1010Each button (key) is represented as a sub-node of "gpio-keys":1111Subnode properties:12121313+ - gpios: OF device-tree gpio specification.1414+ - interrupts: the interrupt line for that input.1315 - label: Descriptive name of the key.1416 - linux,code: Keycode to emit.15171616-Required mutual exclusive subnode-properties:1717- - gpios: OF device-tree gpio specification.1818- - interrupts: the interrupt line for that input1818+Note that either "interrupts" or "gpios" properties can be omitted, but not1919+both at the same time. Specifying both properties is allowed.19202021Optional subnode-properties:2122 - linux,input-type: Specify event type this button/key generates.···2423 - debounce-interval: Debouncing interval time in milliseconds.2524 If not specified defaults to 5.2625 - gpio-key,wakeup: Boolean, button can wake-up the system.2626+ - linux,can-disable: Boolean, indicates that button is connected2727+ to dedicated (not shared) interrupt which can be disabled to2828+ suppress events from the button.27292830Example nodes:2931
···88 - debounce-interval : Debouncing interval time in milliseconds99 - st,scan-count : Scanning cycles elapsed before key data is updated1010 - st,no-autorepeat : If specified device will not autorepeat1111+ - keypad,num-rows : See ./matrix-keymap.txt1212+ - keypad,num-columns : See ./matrix-keymap.txt11131214Example:1315
···203203 compatible = "linux,spdif-dir";204204 };205205};206206-207207-&pinctrl {208208- /*209209- * These pins might be muxed as I2S by210210- * the bootloader, but it conflicts211211- * with the real I2S pins that are212212- * muxed using i2s_pins. We must mux213213- * those pins to a function other than214214- * I2S.215215- */216216- pinctrl-0 = <&hog_pins1 &hog_pins2>;217217- pinctrl-names = "default";218218-219219- hog_pins1: hog-pins1 {220220- marvell,pins = "mpp6", "mpp8", "mpp10",221221- "mpp12", "mpp13";222222- marvell,function = "gpio";223223- };224224-225225- hog_pins2: hog-pins2 {226226- marvell,pins = "mpp5", "mpp7", "mpp9";227227- marvell,function = "gpo";228228- };229229-};
···387387388388void __init smp_cpus_done(unsigned int max_cpus)389389{390390+ int cpu;391391+ unsigned long bogosum = 0;392392+393393+ for_each_online_cpu(cpu)394394+ bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy;395395+396396+ printk(KERN_INFO "SMP: Total of %d processors activated "397397+ "(%lu.%02lu BogoMIPS).\n",398398+ num_online_cpus(),399399+ bogosum / (500000/HZ),400400+ (bogosum / (5000/HZ)) % 100);401401+390402 hyp_mode_check();391403}392404
+1-1
arch/ia64/include/asm/unistd.h
···1111121213131414-#define NR_syscalls 318 /* length of syscall table */1414+#define NR_syscalls 319 /* length of syscall table */15151616/*1717 * The following defines stop scripts/checksyscalls.sh from complaining about
···330330 * using debugger IPI.331331 */332332333333- if (crashing_cpu == -1)333333+ if (!kdump_in_progress())334334 kexec_prepare_cpus();335335336336 pr_debug("kexec: Starting switchover sequence.\n");
+1-8
arch/powerpc/kernel/smp.c
···700700 smp_store_cpu_info(cpu);701701 set_dec(tb_ticks_per_jiffy);702702 preempt_disable();703703+ cpu_callin_map[cpu] = 1;703704704705 if (smp_ops->setup_cpu)705706 smp_ops->setup_cpu(cpu);···738737 smp_wmb();739738 notify_cpu_starting(cpu);740739 set_cpu_online(cpu, true);741741-742742- /*743743- * CPU must be marked active and online before we signal back to the744744- * master, because the scheduler needs to see the cpu_online and745745- * cpu_active bits set.746746- */747747- smp_wmb();748748- cpu_callin_map[cpu] = 1;749740750741 local_irq_enable();751742
+7-1
arch/powerpc/platforms/pseries/lpar.c
···4343#include <asm/trace.h>4444#include <asm/firmware.h>4545#include <asm/plpar_wrappers.h>4646+#include <asm/kexec.h>4647#include <asm/fadump.h>47484849#include "pseries.h"···268267 * out to the user, but at least this will stop us from269268 * continuing on further and creating an even more270269 * difficult to debug situation.270270+ *271271+ * There is a known problem when kdump'ing, if cpus are offline272272+ * the above call will fail. Rather than panicking again, keep273273+ * going and hope the kdump kernel is also little endian, which274274+ * it usually is.271275 */272272- if (rc)276276+ if (rc && !kdump_in_progress())273277 panic("Could not enable big endian exceptions");274278 }275279#endif
···463463464464 /* Register the CP15 based counter if we have one */465465 if (type & ARCH_CP15_TIMER) {466466- if (arch_timer_use_virtual)466466+ if (IS_ENABLED(CONFIG_ARM64) || arch_timer_use_virtual)467467 arch_timer_read_counter = arch_counter_get_cntvct;468468 else469469 arch_timer_read_counter = arch_counter_get_cntpct;
+44-16
drivers/input/evdev.c
···2828#include <linux/cdev.h>2929#include "input-compat.h"30303131+enum evdev_clock_type {3232+ EV_CLK_REAL = 0,3333+ EV_CLK_MONO,3434+ EV_CLK_BOOT,3535+ EV_CLK_MAX3636+};3737+3138struct evdev {3239 int open;3340 struct input_handle handle;···5649 struct fasync_struct *fasync;5750 struct evdev *evdev;5851 struct list_head node;5959- int clkid;5252+ int clk_type;6053 bool revoked;6154 unsigned int bufsize;6255 struct input_event buffer[];6356};5757+5858+static int evdev_set_clk_type(struct evdev_client *client, unsigned int clkid)5959+{6060+ switch (clkid) {6161+6262+ case CLOCK_REALTIME:6363+ client->clk_type = EV_CLK_REAL;6464+ break;6565+ case CLOCK_MONOTONIC:6666+ client->clk_type = EV_CLK_MONO;6767+ break;6868+ case CLOCK_BOOTTIME:6969+ client->clk_type = EV_CLK_BOOT;7070+ break;7171+ default:7272+ return -EINVAL;7373+ }7474+7575+ return 0;7676+}64776578/* flush queued events of type @type, caller must hold client->buffer_lock */6679static void __evdev_flush_queue(struct evdev_client *client, unsigned int type)···135108 struct input_event ev;136109 ktime_t time;137110138138- time = (client->clkid == CLOCK_MONOTONIC) ?139139- ktime_get() : ktime_get_real();111111+ time = client->clk_type == EV_CLK_REAL ?112112+ ktime_get_real() :113113+ client->clk_type == EV_CLK_MONO ?114114+ ktime_get() :115115+ ktime_get_boottime();140116141117 ev.time = ktime_to_timeval(time);142118 ev.type = EV_SYN;···189159190160static void evdev_pass_values(struct evdev_client *client,191161 const struct input_value *vals, unsigned int count,192192- ktime_t mono, ktime_t real)162162+ ktime_t *ev_time)193163{194164 struct evdev *evdev = client->evdev;195165 const struct input_value *v;···199169 if (client->revoked)200170 return;201171202202- event.time = ktime_to_timeval(client->clkid == CLOCK_MONOTONIC ?203203- mono : real);172172+ event.time = ktime_to_timeval(ev_time[client->clk_type]);204173205174 /* Interrupts are disabled, just acquire the lock. */206175 spin_lock(&client->buffer_lock);···227198{228199 struct evdev *evdev = handle->private;229200 struct evdev_client *client;230230- ktime_t time_mono, time_real;201201+ ktime_t ev_time[EV_CLK_MAX];231202232232- time_mono = ktime_get();233233- time_real = ktime_mono_to_real(time_mono);203203+ ev_time[EV_CLK_MONO] = ktime_get();204204+ ev_time[EV_CLK_REAL] = ktime_mono_to_real(ev_time[EV_CLK_MONO]);205205+ ev_time[EV_CLK_BOOT] = ktime_mono_to_any(ev_time[EV_CLK_MONO],206206+ TK_OFFS_BOOT);234207235208 rcu_read_lock();236209237210 client = rcu_dereference(evdev->grab);238211239212 if (client)240240- evdev_pass_values(client, vals, count, time_mono, time_real);213213+ evdev_pass_values(client, vals, count, ev_time);241214 else242215 list_for_each_entry_rcu(client, &evdev->client_list, node)243243- evdev_pass_values(client, vals, count,244244- time_mono, time_real);216216+ evdev_pass_values(client, vals, count, ev_time);245217246218 rcu_read_unlock();247219}···907877 case EVIOCSCLOCKID:908878 if (copy_from_user(&i, p, sizeof(unsigned int)))909879 return -EFAULT;910910- if (i != CLOCK_MONOTONIC && i != CLOCK_REALTIME)911911- return -EINVAL;912912- client->clkid = i;913913- return 0;880880+881881+ return evdev_set_clk_type(client, i);914882915883 case EVIOCGKEYCODE:916884 return evdev_handle_get_keycode(dev, p);
+13-9
drivers/input/input.c
···1974197419751975 events = mt_slots + 1; /* count SYN_MT_REPORT and SYN_REPORT */1976197619771977- for (i = 0; i < ABS_CNT; i++) {19781978- if (test_bit(i, dev->absbit)) {19791979- if (input_is_mt_axis(i))19801980- events += mt_slots;19811981- else19821982- events++;19771977+ if (test_bit(EV_ABS, dev->evbit)) {19781978+ for (i = 0; i < ABS_CNT; i++) {19791979+ if (test_bit(i, dev->absbit)) {19801980+ if (input_is_mt_axis(i))19811981+ events += mt_slots;19821982+ else19831983+ events++;19841984+ }19831985 }19841986 }1985198719861986- for (i = 0; i < REL_CNT; i++)19871987- if (test_bit(i, dev->relbit))19881988- events++;19881988+ if (test_bit(EV_REL, dev->evbit)) {19891989+ for (i = 0; i < REL_CNT; i++)19901990+ if (test_bit(i, dev->relbit))19911991+ events++;19921992+ }1989199319901994 /* Make room for KEY and MSC events */19911995 events += 7;
+1
drivers/input/keyboard/Kconfig
···559559config KEYBOARD_STMPE560560 tristate "STMPE keypad support"561561 depends on MFD_STMPE562562+ depends on OF562563 select INPUT_MATRIXKMAP563564 help564565 Say Y here if you want to use the keypad controller on STMPE I/O
+57-57
drivers/input/keyboard/gpio_keys.c
···3535struct gpio_button_data {3636 const struct gpio_keys_button *button;3737 struct input_dev *input;3838- struct timer_list timer;3939- struct work_struct work;4040- unsigned int timer_debounce; /* in msecs */3838+3939+ struct timer_list release_timer;4040+ unsigned int release_delay; /* in msecs, for IRQ-only buttons */4141+4242+ struct delayed_work work;4343+ unsigned int software_debounce; /* in msecs, for GPIO-driven buttons */4444+4145 unsigned int irq;4246 spinlock_t lock;4347 bool disabled;···120116{121117 if (!bdata->disabled) {122118 /*123123- * Disable IRQ and possible debouncing timer.119119+ * Disable IRQ and associated timer/work structure.124120 */125121 disable_irq(bdata->irq);126126- if (bdata->timer_debounce)127127- del_timer_sync(&bdata->timer);122122+123123+ if (gpio_is_valid(bdata->button->gpio))124124+ cancel_delayed_work_sync(&bdata->work);125125+ else126126+ del_timer_sync(&bdata->release_timer);128127129128 bdata->disabled = true;130129 }···350343static void gpio_keys_gpio_work_func(struct work_struct *work)351344{352345 struct gpio_button_data *bdata =353353- container_of(work, struct gpio_button_data, work);346346+ container_of(work, struct gpio_button_data, work.work);354347355348 gpio_keys_gpio_report_event(bdata);356349357350 if (bdata->button->wakeup)358351 pm_relax(bdata->input->dev.parent);359359-}360360-361361-static void gpio_keys_gpio_timer(unsigned long _data)362362-{363363- struct gpio_button_data *bdata = (struct gpio_button_data *)_data;364364-365365- schedule_work(&bdata->work);366352}367353368354static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id)···366366367367 if (bdata->button->wakeup)368368 pm_stay_awake(bdata->input->dev.parent);369369- if (bdata->timer_debounce)370370- mod_timer(&bdata->timer,371371- jiffies + msecs_to_jiffies(bdata->timer_debounce));372372- else373373- schedule_work(&bdata->work);369369+370370+ mod_delayed_work(system_wq,371371+ &bdata->work,372372+ msecs_to_jiffies(bdata->software_debounce));374373375374 return IRQ_HANDLED;376375}···407408 input_event(input, EV_KEY, button->code, 1);408409 input_sync(input);409410410410- if (!bdata->timer_debounce) {411411+ if (!bdata->release_delay) {411412 input_event(input, EV_KEY, button->code, 0);412413 input_sync(input);413414 goto out;···416417 bdata->key_pressed = true;417418 }418419419419- if (bdata->timer_debounce)420420- mod_timer(&bdata->timer,421421- jiffies + msecs_to_jiffies(bdata->timer_debounce));420420+ if (bdata->release_delay)421421+ mod_timer(&bdata->release_timer,422422+ jiffies + msecs_to_jiffies(bdata->release_delay));422423out:423424 spin_unlock_irqrestore(&bdata->lock, flags);424425 return IRQ_HANDLED;···428429{429430 struct gpio_button_data *bdata = data;430431431431- if (bdata->timer_debounce)432432- del_timer_sync(&bdata->timer);433433-434434- cancel_work_sync(&bdata->work);432432+ if (gpio_is_valid(bdata->button->gpio))433433+ cancel_delayed_work_sync(&bdata->work);434434+ else435435+ del_timer_sync(&bdata->release_timer);435436}436437437438static int gpio_keys_setup_key(struct platform_device *pdev,···465466 button->debounce_interval * 1000);466467 /* use timer if gpiolib doesn't provide debounce */467468 if (error < 0)468468- bdata->timer_debounce =469469+ bdata->software_debounce =469470 button->debounce_interval;470471 }471472472472- irq = gpio_to_irq(button->gpio);473473- if (irq < 0) {474474- error = irq;475475- dev_err(dev,476476- "Unable to get irq number for GPIO %d, error %d\n",477477- button->gpio, error);478478- return error;473473+ if (button->irq) {474474+ bdata->irq = button->irq;475475+ } else {476476+ irq = gpio_to_irq(button->gpio);477477+ if (irq < 0) {478478+ error = irq;479479+ dev_err(dev,480480+ "Unable to get irq number for GPIO %d, error %d\n",481481+ button->gpio, error);482482+ return error;483483+ }484484+ bdata->irq = irq;479485 }480480- bdata->irq = irq;481486482482- INIT_WORK(&bdata->work, gpio_keys_gpio_work_func);483483- setup_timer(&bdata->timer,484484- gpio_keys_gpio_timer, (unsigned long)bdata);487487+ INIT_DELAYED_WORK(&bdata->work, gpio_keys_gpio_work_func);485488486489 isr = gpio_keys_gpio_isr;487490 irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;···500499 return -EINVAL;501500 }502501503503- bdata->timer_debounce = button->debounce_interval;504504- setup_timer(&bdata->timer,502502+ bdata->release_delay = button->debounce_interval;503503+ setup_timer(&bdata->release_timer,505504 gpio_keys_irq_timer, (unsigned long)bdata);506505507506 isr = gpio_keys_irq_isr;···511510 input_set_capability(input, button->type ?: EV_KEY, button->code);512511513512 /*514514- * Install custom action to cancel debounce timer and513513+ * Install custom action to cancel release timer and515514 * workqueue item.516515 */517516 error = devm_add_action(&pdev->dev, gpio_keys_quiesce_key, bdata);···619618620619 i = 0;621620 for_each_child_of_node(node, pp) {622622- int gpio = -1;623621 enum of_gpio_flags flags;624622625623 button = &pdata->buttons[i++];626624627627- if (!of_find_property(pp, "gpios", NULL)) {628628- button->irq = irq_of_parse_and_map(pp, 0);629629- if (button->irq == 0) {630630- i--;631631- pdata->nbuttons--;632632- dev_warn(dev, "Found button without gpios or irqs\n");633633- continue;634634- }635635- } else {636636- gpio = of_get_gpio_flags(pp, 0, &flags);637637- if (gpio < 0) {638638- error = gpio;625625+ button->gpio = of_get_gpio_flags(pp, 0, &flags);626626+ if (button->gpio < 0) {627627+ error = button->gpio;628628+ if (error != -ENOENT) {639629 if (error != -EPROBE_DEFER)640630 dev_err(dev,641631 "Failed to get gpio flags, error: %d\n",642632 error);643633 return ERR_PTR(error);644634 }635635+ } else {636636+ button->active_low = flags & OF_GPIO_ACTIVE_LOW;645637 }646638647647- button->gpio = gpio;648648- button->active_low = flags & OF_GPIO_ACTIVE_LOW;639639+ button->irq = irq_of_parse_and_map(pp, 0);640640+641641+ if (!gpio_is_valid(button->gpio) && !button->irq) {642642+ dev_err(dev, "Found button without gpios or irqs\n");643643+ return ERR_PTR(-EINVAL);644644+ }649645650646 if (of_property_read_u32(pp, "linux,code", &button->code)) {651647 dev_err(dev, "Button without keycode: 0x%x\n",···656658 button->type = EV_KEY;657659658660 button->wakeup = !!of_get_property(pp, "gpio-key,wakeup", NULL);661661+662662+ button->can_disable = !!of_get_property(pp, "linux,can-disable", NULL);659663660664 if (of_property_read_u32(pp, "debounce-interval",661665 &button->debounce_interval))
···4545#define STMPE_KEYPAD_MAX_ROWS 84646#define STMPE_KEYPAD_MAX_COLS 84747#define STMPE_KEYPAD_ROW_SHIFT 34848-#define STMPE_KEYPAD_KEYMAP_SIZE \4848+#define STMPE_KEYPAD_KEYMAP_MAX_SIZE \4949 (STMPE_KEYPAD_MAX_ROWS * STMPE_KEYPAD_MAX_COLS)50505151/**5252 * struct stmpe_keypad_variant - model-specific attributes5353 * @auto_increment: whether the KPC_DATA_BYTE register address5454 * auto-increments on multiple read5555+ * @set_pullup: whether the pins need to have their pull-ups set5556 * @num_data: number of data bytes5657 * @num_normal_data: number of normal keys' data bytes5758 * @max_cols: maximum number of columns supported···6261 */6362struct stmpe_keypad_variant {6463 bool auto_increment;6464+ bool set_pullup;6565 int num_data;6666 int num_normal_data;6767 int max_cols;···8381 },8482 [STMPE2401] = {8583 .auto_increment = false,8484+ .set_pullup = true,8685 .num_data = 3,8786 .num_normal_data = 2,8887 .max_cols = 8,···9390 },9491 [STMPE2403] = {9592 .auto_increment = true,9393+ .set_pullup = true,9694 .num_data = 5,9795 .num_normal_data = 3,9896 .max_cols = 8,···10399 },104100};105101102102+/**103103+ * struct stmpe_keypad - STMPE keypad state container104104+ * @stmpe: pointer to parent STMPE device105105+ * @input: spawned input device106106+ * @variant: STMPE variant107107+ * @debounce_ms: debounce interval, in ms. Maximum is108108+ * %STMPE_KEYPAD_MAX_DEBOUNCE.109109+ * @scan_count: number of key scanning cycles to confirm key data.110110+ * Maximum is %STMPE_KEYPAD_MAX_SCAN_COUNT.111111+ * @no_autorepeat: disable key autorepeat112112+ * @rows: bitmask for the rows113113+ * @cols: bitmask for the columns114114+ * @keymap: the keymap115115+ */106116struct stmpe_keypad {107117 struct stmpe *stmpe;108118 struct input_dev *input;109119 const struct stmpe_keypad_variant *variant;110110- const struct stmpe_keypad_platform_data *plat;111111-120120+ unsigned int debounce_ms;121121+ unsigned int scan_count;122122+ bool no_autorepeat;112123 unsigned int rows;113124 unsigned int cols;114114-115115- unsigned short keymap[STMPE_KEYPAD_KEYMAP_SIZE];125125+ unsigned short keymap[STMPE_KEYPAD_KEYMAP_MAX_SIZE];116126};117127118128static int stmpe_keypad_read_data(struct stmpe_keypad *keypad, u8 *data)···189171 unsigned int col_gpios = variant->col_gpios;190172 unsigned int row_gpios = variant->row_gpios;191173 struct stmpe *stmpe = keypad->stmpe;174174+ u8 pureg = stmpe->regs[STMPE_IDX_GPPUR_LSB];192175 unsigned int pins = 0;176176+ unsigned int pu_pins = 0;177177+ int ret;193178 int i;194179195180 /*···209188 for (i = 0; i < variant->max_cols; i++) {210189 int num = __ffs(col_gpios);211190212212- if (keypad->cols & (1 << i))191191+ if (keypad->cols & (1 << i)) {213192 pins |= 1 << num;193193+ pu_pins |= 1 << num;194194+ }214195215196 col_gpios &= ~(1 << num);216197 }···226203 row_gpios &= ~(1 << num);227204 }228205229229- return stmpe_set_altfunc(stmpe, pins, STMPE_BLOCK_KEYPAD);206206+ ret = stmpe_set_altfunc(stmpe, pins, STMPE_BLOCK_KEYPAD);207207+ if (ret)208208+ return ret;209209+210210+ /*211211+ * On STMPE24xx, set pin bias to pull-up on all keypad input212212+ * pins (columns), this incidentally happen to be maximum 8 pins213213+ * and placed at GPIO0-7 so only the LSB of the pull up register214214+ * ever needs to be written.215215+ */216216+ if (variant->set_pullup) {217217+ u8 val;218218+219219+ ret = stmpe_reg_read(stmpe, pureg);220220+ if (ret)221221+ return ret;222222+223223+ /* Do not touch unused pins, may be used for GPIO */224224+ val = ret & ~pu_pins;225225+ val |= pu_pins;226226+227227+ ret = stmpe_reg_write(stmpe, pureg, val);228228+ }229229+230230+ return 0;230231}231232232233static int stmpe_keypad_chip_init(struct stmpe_keypad *keypad)233234{234234- const struct stmpe_keypad_platform_data *plat = keypad->plat;235235 const struct stmpe_keypad_variant *variant = keypad->variant;236236 struct stmpe *stmpe = keypad->stmpe;237237 int ret;238238239239- if (plat->debounce_ms > STMPE_KEYPAD_MAX_DEBOUNCE)239239+ if (keypad->debounce_ms > STMPE_KEYPAD_MAX_DEBOUNCE)240240 return -EINVAL;241241242242- if (plat->scan_count > STMPE_KEYPAD_MAX_SCAN_COUNT)242242+ if (keypad->scan_count > STMPE_KEYPAD_MAX_SCAN_COUNT)243243 return -EINVAL;244244245245 ret = stmpe_enable(stmpe, STMPE_BLOCK_KEYPAD);···291245292246 ret = stmpe_set_bits(stmpe, STMPE_KPC_CTRL_MSB,293247 STMPE_KPC_CTRL_MSB_SCAN_COUNT,294294- plat->scan_count << 4);248248+ keypad->scan_count << 4);295249 if (ret < 0)296250 return ret;297251···299253 STMPE_KPC_CTRL_LSB_SCAN |300254 STMPE_KPC_CTRL_LSB_DEBOUNCE,301255 STMPE_KPC_CTRL_LSB_SCAN |302302- (plat->debounce_ms << 1));256256+ (keypad->debounce_ms << 1));303257}304258305305-static void stmpe_keypad_fill_used_pins(struct stmpe_keypad *keypad)259259+static void stmpe_keypad_fill_used_pins(struct stmpe_keypad *keypad,260260+ u32 used_rows, u32 used_cols)306261{307262 int row, col;308263309309- for (row = 0; row < STMPE_KEYPAD_MAX_ROWS; row++) {310310- for (col = 0; col < STMPE_KEYPAD_MAX_COLS; col++) {264264+ for (row = 0; row < used_rows; row++) {265265+ for (col = 0; col < used_cols; col++) {311266 int code = MATRIX_SCAN_CODE(row, col,312312- STMPE_KEYPAD_ROW_SHIFT);267267+ STMPE_KEYPAD_ROW_SHIFT);313268 if (keypad->keymap[code] != KEY_RESERVED) {314269 keypad->rows |= 1 << row;315270 keypad->cols |= 1 << col;···319272 }320273}321274322322-#ifdef CONFIG_OF323323-static const struct stmpe_keypad_platform_data *324324-stmpe_keypad_of_probe(struct device *dev)325325-{326326- struct device_node *np = dev->of_node;327327- struct stmpe_keypad_platform_data *plat;328328-329329- if (!np)330330- return ERR_PTR(-ENODEV);331331-332332- plat = devm_kzalloc(dev, sizeof(*plat), GFP_KERNEL);333333- if (!plat)334334- return ERR_PTR(-ENOMEM);335335-336336- of_property_read_u32(np, "debounce-interval", &plat->debounce_ms);337337- of_property_read_u32(np, "st,scan-count", &plat->scan_count);338338-339339- plat->no_autorepeat = of_property_read_bool(np, "st,no-autorepeat");340340-341341- return plat;342342-}343343-#else344344-static inline const struct stmpe_keypad_platform_data *345345-stmpe_keypad_of_probe(struct device *dev)346346-{347347- return ERR_PTR(-EINVAL);348348-}349349-#endif350350-351275static int stmpe_keypad_probe(struct platform_device *pdev)352276{353277 struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent);354354- const struct stmpe_keypad_platform_data *plat;278278+ struct device_node *np = pdev->dev.of_node;355279 struct stmpe_keypad *keypad;356280 struct input_dev *input;281281+ u32 rows;282282+ u32 cols;357283 int error;358284 int irq;359359-360360- plat = stmpe->pdata->keypad;361361- if (!plat) {362362- plat = stmpe_keypad_of_probe(&pdev->dev);363363- if (IS_ERR(plat))364364- return PTR_ERR(plat);365365- }366285367286 irq = platform_get_irq(pdev, 0);368287 if (irq < 0)···339326 if (!keypad)340327 return -ENOMEM;341328329329+ keypad->stmpe = stmpe;330330+ keypad->variant = &stmpe_keypad_variants[stmpe->partnum];331331+332332+ of_property_read_u32(np, "debounce-interval", &keypad->debounce_ms);333333+ of_property_read_u32(np, "st,scan-count", &keypad->scan_count);334334+ keypad->no_autorepeat = of_property_read_bool(np, "st,no-autorepeat");335335+342336 input = devm_input_allocate_device(&pdev->dev);343337 if (!input)344338 return -ENOMEM;···354334 input->id.bustype = BUS_I2C;355335 input->dev.parent = &pdev->dev;356336357357- error = matrix_keypad_build_keymap(plat->keymap_data, NULL,358358- STMPE_KEYPAD_MAX_ROWS,359359- STMPE_KEYPAD_MAX_COLS,337337+ error = matrix_keypad_parse_of_params(&pdev->dev, &rows, &cols);338338+ if (error)339339+ return error;340340+341341+ error = matrix_keypad_build_keymap(NULL, NULL, rows, cols,360342 keypad->keymap, input);361343 if (error)362344 return error;363345364346 input_set_capability(input, EV_MSC, MSC_SCAN);365365- if (!plat->no_autorepeat)347347+ if (!keypad->no_autorepeat)366348 __set_bit(EV_REP, input->evbit);367349368368- stmpe_keypad_fill_used_pins(keypad);350350+ stmpe_keypad_fill_used_pins(keypad, rows, cols);369351370370- keypad->stmpe = stmpe;371371- keypad->plat = plat;372352 keypad->input = input;373373- keypad->variant = &stmpe_keypad_variants[stmpe->partnum];374353375354 error = stmpe_keypad_chip_init(keypad);376355 if (error < 0)
+74-10
drivers/input/mouse/alps.c
···881881 unsigned char *pkt,882882 unsigned char pkt_id)883883{884884+ /*885885+ * packet-fmt b7 b6 b5 b4 b3 b2 b1 b0886886+ * Byte0 TWO & MULTI L 1 R M 1 Y0-2 Y0-1 Y0-0887887+ * Byte0 NEW L 1 X1-5 1 1 Y0-2 Y0-1 Y0-0888888+ * Byte1 Y0-10 Y0-9 Y0-8 Y0-7 Y0-6 Y0-5 Y0-4 Y0-3889889+ * Byte2 X0-11 1 X0-10 X0-9 X0-8 X0-7 X0-6 X0-5890890+ * Byte3 X1-11 1 X0-4 X0-3 1 X0-2 X0-1 X0-0891891+ * Byte4 TWO X1-10 TWO X1-9 X1-8 X1-7 X1-6 X1-5 X1-4892892+ * Byte4 MULTI X1-10 TWO X1-9 X1-8 X1-7 X1-6 Y1-5 1893893+ * Byte4 NEW X1-10 TWO X1-9 X1-8 X1-7 X1-6 0 0894894+ * Byte5 TWO & NEW Y1-10 0 Y1-9 Y1-8 Y1-7 Y1-6 Y1-5 Y1-4895895+ * Byte5 MULTI Y1-10 0 Y1-9 Y1-8 Y1-7 Y1-6 F-1 F-0896896+ * L: Left button897897+ * R / M: Non-clickpads: Right / Middle button898898+ * Clickpads: When > 2 fingers are down, and some fingers899899+ * are in the button area, then the 2 coordinates reported900900+ * are for fingers outside the button area and these report901901+ * extra fingers being present in the right / left button902902+ * area. Note these fingers are not added to the F field!903903+ * so if a TWO packet is received and R = 1 then there are904904+ * 3 fingers down, etc.905905+ * TWO: 1: Two touches present, byte 0/4/5 are in TWO fmt906906+ * 0: If byte 4 bit 0 is 1, then byte 0/4/5 are in MULTI fmt907907+ * otherwise byte 0 bit 4 must be set and byte 0/4/5 are908908+ * in NEW fmt909909+ * F: Number of fingers - 3, 0 means 3 fingers, 1 means 4 ...910910+ */911911+884912 mt[0].x = ((pkt[2] & 0x80) << 4);885913 mt[0].x |= ((pkt[2] & 0x3F) << 5);886914 mt[0].x |= ((pkt[3] & 0x30) >> 1);···947919948920static int alps_get_mt_count(struct input_mt_pos *mt)949921{950950- int i;922922+ int i, fingers = 0;951923952952- for (i = 0; i < MAX_TOUCHES && mt[i].x != 0 && mt[i].y != 0; i++)953953- /* empty */;924924+ for (i = 0; i < MAX_TOUCHES; i++) {925925+ if (mt[i].x != 0 || mt[i].y != 0)926926+ fingers++;927927+ }954928955955- return i;929929+ return fingers;956930}957931958932static int alps_decode_packet_v7(struct alps_fields *f,959933 unsigned char *p,960934 struct psmouse *psmouse)961935{936936+ struct alps_data *priv = psmouse->private;962937 unsigned char pkt_id;963938964939 pkt_id = alps_get_packet_id_v7(p);···969938 return 0;970939 if (pkt_id == V7_PACKET_ID_UNKNOWN)971940 return -1;941941+ /*942942+ * NEW packets are send to indicate a discontinuity in the finger943943+ * coordinate reporting. Specifically a finger may have moved from944944+ * slot 0 to 1 or vice versa. INPUT_MT_TRACK takes care of this for945945+ * us.946946+ *947947+ * NEW packets have 3 problems:948948+ * 1) They do not contain middle / right button info (on non clickpads)949949+ * this can be worked around by preserving the old button state950950+ * 2) They do not contain an accurate fingercount, and they are951951+ * typically send when the number of fingers changes. We cannot use952952+ * the old finger count as that may mismatch with the amount of953953+ * touch coordinates we've available in the NEW packet954954+ * 3) Their x data for the second touch is inaccurate leading to955955+ * a possible jump of the x coordinate by 16 units when the first956956+ * non NEW packet comes in957957+ * Since problems 2 & 3 cannot be worked around, just ignore them.958958+ */959959+ if (pkt_id == V7_PACKET_ID_NEW)960960+ return 1;972961973962 alps_get_finger_coordinate_v7(f->mt, p, pkt_id);974963975975- if (pkt_id == V7_PACKET_ID_TWO || pkt_id == V7_PACKET_ID_MULTI) {976976- f->left = (p[0] & 0x80) >> 7;964964+ if (pkt_id == V7_PACKET_ID_TWO)965965+ f->fingers = alps_get_mt_count(f->mt);966966+ else /* pkt_id == V7_PACKET_ID_MULTI */967967+ f->fingers = 3 + (p[5] & 0x03);968968+969969+ f->left = (p[0] & 0x80) >> 7;970970+ if (priv->flags & ALPS_BUTTONPAD) {971971+ if (p[0] & 0x20)972972+ f->fingers++;973973+ if (p[0] & 0x10)974974+ f->fingers++;975975+ } else {977976 f->right = (p[0] & 0x20) >> 5;978977 f->middle = (p[0] & 0x10) >> 4;979978 }980979981981- if (pkt_id == V7_PACKET_ID_TWO)982982- f->fingers = alps_get_mt_count(f->mt);983983- else if (pkt_id == V7_PACKET_ID_MULTI)984984- f->fingers = 3 + (p[5] & 0x03);980980+ /* Sometimes a single touch is reported in mt[1] rather then mt[0] */981981+ if (f->fingers == 1 && f->mt[0].x == 0 && f->mt[0].y == 0) {982982+ f->mt[0].x = f->mt[1].x;983983+ f->mt[0].y = f->mt[1].y;984984+ f->mt[1].x = 0;985985+ f->mt[1].y = 0;986986+ }985987986988 return 0;987989}
···11251125 u32 swmask = mask;11261126 u32 fwmask = mask << 16;11271127 s32 ret_val = 0;11281128- s32 i = 0, timeout = 200; /* FIXME: find real value to use here */11281128+ s32 i = 0, timeout = 200;1129112911301130 while (i < timeout) {11311131 if (igb_get_hw_semaphore(hw)) {
···40334033 (void)pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));40344034 mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd),40354035 &mgp->cmd_bus, GFP_KERNEL);40364036- if (mgp->cmd == NULL)40364036+ if (!mgp->cmd) {40374037+ status = -ENOMEM;40374038 goto abort_with_enabled;40394039+ }4038404040394041 mgp->board_span = pci_resource_len(pdev, 0);40404042 mgp->iomem_base = pci_resource_start(pdev, 0);
+3-5
drivers/net/ethernet/qlogic/qla3xxx.c
···146146{147147 int i = 0;148148149149- while (i < 10) {150150- if (i)151151- ssleep(1);152152-149149+ do {153150 if (ql_sem_lock(qdev,154151 QL_DRVR_SEM_MASK,155152 (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index)···155158 "driver lock acquired\n");156159 return 1;157160 }158158- }161161+ ssleep(1);162162+ } while (++i < 10);159163160164 netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n");161165 return 0;
···5656/* default ethernet address used by the modem */5757static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3};58585959+static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00};6060+5961/* Make up an ethernet header if the packet doesn't have one.6062 *6163 * A firmware bug common among several devices cause them to send raw···334332 usb_driver_release_interface(driver, info->data);335333 }336334337337- /* Never use the same address on both ends of the link, even338338- * if the buggy firmware told us to.335335+ /* Never use the same address on both ends of the link, even if the336336+ * buggy firmware told us to. Or, if device is assigned the well-known337337+ * buggy firmware MAC address, replace it with a random address,339338 */340340- if (ether_addr_equal(dev->net->dev_addr, default_modem_addr))339339+ if (ether_addr_equal(dev->net->dev_addr, default_modem_addr) ||340340+ ether_addr_equal(dev->net->dev_addr, buggy_fw_addr))341341 eth_hw_addr_random(dev->net);342342343343 /* make MAC addr easily distinguishable from an IP header */
···18921892 goto fnic_abort_cmd_end;18931893 }1894189418951895+ /* IO out of order */18961896+18971897+ if (!(CMD_FLAGS(sc) & (FNIC_IO_ABORTED | FNIC_IO_DONE))) {18981898+ spin_unlock_irqrestore(io_lock, flags);18991899+ FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,19001900+ "Issuing Host reset due to out of order IO\n");19011901+19021902+ if (fnic_host_reset(sc) == FAILED) {19031903+ FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,19041904+ "fnic_host_reset failed.\n");19051905+ }19061906+ ret = FAILED;19071907+ goto fnic_abort_cmd_end;19081908+ }19091909+18951910 CMD_STATE(sc) = FNIC_IOREQ_ABTS_COMPLETE;1896191118971912 /*
···26232623 sd_config_discard(sdkp, SD_LBP_WS16);2624262426252625 } else { /* LBP VPD page tells us what to use */26262626-26272627- if (sdkp->lbpws)26262626+ if (sdkp->lbpu && sdkp->max_unmap_blocks && !sdkp->lbprz)26272627+ sd_config_discard(sdkp, SD_LBP_UNMAP);26282628+ else if (sdkp->lbpws)26282629 sd_config_discard(sdkp, SD_LBP_WS16);26292630 else if (sdkp->lbpws10)26302631 sd_config_discard(sdkp, SD_LBP_WS10);
···9797 return 0;98989999err_enable:100100- regulator_disable(pll->regulator);100100+ if (pll->regulator)101101+ regulator_disable(pll->regulator);101102err_reg:102103 clk_disable_unprepare(pll->clkin);103104 return r;
+2
drivers/video/fbdev/omap2/dss/sdi.c
···342342 out->output_type = OMAP_DISPLAY_TYPE_SDI;343343 out->name = "sdi.0";344344 out->dispc_channel = OMAP_DSS_CHANNEL_LCD;345345+ /* We have SDI only on OMAP3, where it's on port 1 */346346+ out->port_num = 1;345347 out->ops.sdi = &sdi_ops;346348 out->owner = THIS_MODULE;347349
+16-1
drivers/video/logo/logo.c
···2121module_param(nologo, bool, 0);2222MODULE_PARM_DESC(nologo, "Disables startup logo");23232424+/*2525+ * Logos are located in the initdata, and will be freed in kernel_init.2626+ * Use late_init to mark the logos as freed to prevent any further use.2727+ */2828+2929+static bool logos_freed;3030+3131+static int __init fb_logo_late_init(void)3232+{3333+ logos_freed = true;3434+ return 0;3535+}3636+3737+late_initcall(fb_logo_late_init);3838+2439/* logo's are marked __initdata. Use __init_refok to tell2540 * modpost that it is intended that this function uses data2641 * marked __initdata.···4429{4530 const struct linux_logo *logo = NULL;46314747- if (nologo)3232+ if (nologo || logos_freed)4833 return NULL;49345035 if (depth >= 1) {
+2-2
fs/ext4/extents.c
···5166516651675167 /* fallback to generic here if not in extents fmt */51685168 if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))51695169- return __generic_block_fiemap(inode, fieinfo, start, len,51705170- ext4_get_block);51695169+ return generic_block_fiemap(inode, fieinfo, start, len,51705170+ ext4_get_block);5171517151725172 if (fiemap_check_flags(fieinfo, EXT4_FIEMAP_FLAGS))51735173 return -EBADR;
+116-108
fs/ext4/file.c
···273273 * we determine this extent as a data or a hole according to whether the274274 * page cache has data or not.275275 */276276-static int ext4_find_unwritten_pgoff(struct inode *inode, int whence,277277- loff_t endoff, loff_t *offset)276276+static int ext4_find_unwritten_pgoff(struct inode *inode,277277+ int whence,278278+ struct ext4_map_blocks *map,279279+ loff_t *offset)278280{279281 struct pagevec pvec;282282+ unsigned int blkbits;280283 pgoff_t index;281284 pgoff_t end;285285+ loff_t endoff;282286 loff_t startoff;283287 loff_t lastoff;284288 int found = 0;285289290290+ blkbits = inode->i_sb->s_blocksize_bits;286291 startoff = *offset;287292 lastoff = startoff;288288-293293+ endoff = (loff_t)(map->m_lblk + map->m_len) << blkbits;289294290295 index = startoff >> PAGE_CACHE_SHIFT;291296 end = endoff >> PAGE_CACHE_SHIFT;···408403static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize)409404{410405 struct inode *inode = file->f_mapping->host;411411- struct fiemap_extent_info fie;412412- struct fiemap_extent ext[2];413413- loff_t next;414414- int i, ret = 0;406406+ struct ext4_map_blocks map;407407+ struct extent_status es;408408+ ext4_lblk_t start, last, end;409409+ loff_t dataoff, isize;410410+ int blkbits;411411+ int ret = 0;415412416413 mutex_lock(&inode->i_mutex);417417- if (offset >= inode->i_size) {414414+415415+ isize = i_size_read(inode);416416+ if (offset >= isize) {418417 mutex_unlock(&inode->i_mutex);419418 return -ENXIO;420419 }421421- fie.fi_flags = 0;422422- fie.fi_extents_max = 2;423423- fie.fi_extents_start = (struct fiemap_extent __user *) &ext;424424- while (1) {425425- mm_segment_t old_fs = get_fs();426420427427- fie.fi_extents_mapped = 0;428428- memset(ext, 0, sizeof(*ext) * fie.fi_extents_max);421421+ blkbits = inode->i_sb->s_blocksize_bits;422422+ start = offset >> blkbits;423423+ last = start;424424+ end = isize >> blkbits;425425+ dataoff = offset;429426430430- set_fs(get_ds());431431- ret = ext4_fiemap(inode, &fie, offset, maxsize - offset);432432- set_fs(old_fs);433433- if (ret)434434- break;435435-436436- /* No extents found, EOF */437437- if (!fie.fi_extents_mapped) {438438- ret = -ENXIO;427427+ do {428428+ map.m_lblk = last;429429+ map.m_len = end - last + 1;430430+ ret = ext4_map_blocks(NULL, inode, &map, 0);431431+ if (ret > 0 && !(map.m_flags & EXT4_MAP_UNWRITTEN)) {432432+ if (last != start)433433+ dataoff = (loff_t)last << blkbits;439434 break;440435 }441441- for (i = 0; i < fie.fi_extents_mapped; i++) {442442- next = (loff_t)(ext[i].fe_length + ext[i].fe_logical);443436444444- if (offset < (loff_t)ext[i].fe_logical)445445- offset = (loff_t)ext[i].fe_logical;446446- /*447447- * If extent is not unwritten, then it contains valid448448- * data, mapped or delayed.449449- */450450- if (!(ext[i].fe_flags & FIEMAP_EXTENT_UNWRITTEN))451451- goto out;452452-453453- /*454454- * If there is a unwritten extent at this offset,455455- * it will be as a data or a hole according to page456456- * cache that has data or not.457457- */458458- if (ext4_find_unwritten_pgoff(inode, SEEK_DATA,459459- next, &offset))460460- goto out;461461-462462- if (ext[i].fe_flags & FIEMAP_EXTENT_LAST) {463463- ret = -ENXIO;464464- goto out;465465- }466466- offset = next;437437+ /*438438+ * If there is a delay extent at this offset,439439+ * it will be as a data.440440+ */441441+ ext4_es_find_delayed_extent_range(inode, last, last, &es);442442+ if (es.es_len != 0 && in_range(last, es.es_lblk, es.es_len)) {443443+ if (last != start)444444+ dataoff = (loff_t)last << blkbits;445445+ break;467446 }468468- }469469- if (offset > inode->i_size)470470- offset = inode->i_size;471471-out:447447+448448+ /*449449+ * If there is a unwritten extent at this offset,450450+ * it will be as a data or a hole according to page451451+ * cache that has data or not.452452+ */453453+ if (map.m_flags & EXT4_MAP_UNWRITTEN) {454454+ int unwritten;455455+ unwritten = ext4_find_unwritten_pgoff(inode, SEEK_DATA,456456+ &map, &dataoff);457457+ if (unwritten)458458+ break;459459+ }460460+461461+ last++;462462+ dataoff = (loff_t)last << blkbits;463463+ } while (last <= end);464464+472465 mutex_unlock(&inode->i_mutex);473473- if (ret)474474- return ret;475466476476- return vfs_setpos(file, offset, maxsize);467467+ if (dataoff > isize)468468+ return -ENXIO;469469+470470+ return vfs_setpos(file, dataoff, maxsize);477471}478472479473/*480480- * ext4_seek_hole() retrieves the offset for SEEK_HOLE474474+ * ext4_seek_hole() retrieves the offset for SEEK_HOLE.481475 */482476static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize)483477{484478 struct inode *inode = file->f_mapping->host;485485- struct fiemap_extent_info fie;486486- struct fiemap_extent ext[2];487487- loff_t next;488488- int i, ret = 0;479479+ struct ext4_map_blocks map;480480+ struct extent_status es;481481+ ext4_lblk_t start, last, end;482482+ loff_t holeoff, isize;483483+ int blkbits;484484+ int ret = 0;489485490486 mutex_lock(&inode->i_mutex);491491- if (offset >= inode->i_size) {487487+488488+ isize = i_size_read(inode);489489+ if (offset >= isize) {492490 mutex_unlock(&inode->i_mutex);493491 return -ENXIO;494492 }495493496496- fie.fi_flags = 0;497497- fie.fi_extents_max = 2;498498- fie.fi_extents_start = (struct fiemap_extent __user *)&ext;499499- while (1) {500500- mm_segment_t old_fs = get_fs();494494+ blkbits = inode->i_sb->s_blocksize_bits;495495+ start = offset >> blkbits;496496+ last = start;497497+ end = isize >> blkbits;498498+ holeoff = offset;501499502502- fie.fi_extents_mapped = 0;503503- memset(ext, 0, sizeof(*ext));500500+ do {501501+ map.m_lblk = last;502502+ map.m_len = end - last + 1;503503+ ret = ext4_map_blocks(NULL, inode, &map, 0);504504+ if (ret > 0 && !(map.m_flags & EXT4_MAP_UNWRITTEN)) {505505+ last += ret;506506+ holeoff = (loff_t)last << blkbits;507507+ continue;508508+ }504509505505- set_fs(get_ds());506506- ret = ext4_fiemap(inode, &fie, offset, maxsize - offset);507507- set_fs(old_fs);508508- if (ret)509509- break;510510+ /*511511+ * If there is a delay extent at this offset,512512+ * we will skip this extent.513513+ */514514+ ext4_es_find_delayed_extent_range(inode, last, last, &es);515515+ if (es.es_len != 0 && in_range(last, es.es_lblk, es.es_len)) {516516+ last = es.es_lblk + es.es_len;517517+ holeoff = (loff_t)last << blkbits;518518+ continue;519519+ }510520511511- /* No extents found */512512- if (!fie.fi_extents_mapped)513513- break;514514-515515- for (i = 0; i < fie.fi_extents_mapped; i++) {516516- next = (loff_t)(ext[i].fe_logical + ext[i].fe_length);517517- /*518518- * If extent is not unwritten, then it contains valid519519- * data, mapped or delayed.520520- */521521- if (!(ext[i].fe_flags & FIEMAP_EXTENT_UNWRITTEN)) {522522- if (offset < (loff_t)ext[i].fe_logical)523523- goto out;524524- offset = next;521521+ /*522522+ * If there is a unwritten extent at this offset,523523+ * it will be as a data or a hole according to page524524+ * cache that has data or not.525525+ */526526+ if (map.m_flags & EXT4_MAP_UNWRITTEN) {527527+ int unwritten;528528+ unwritten = ext4_find_unwritten_pgoff(inode, SEEK_HOLE,529529+ &map, &holeoff);530530+ if (!unwritten) {531531+ last += ret;532532+ holeoff = (loff_t)last << blkbits;525533 continue;526534 }527527- /*528528- * If there is a unwritten extent at this offset,529529- * it will be as a data or a hole according to page530530- * cache that has data or not.531531- */532532- if (ext4_find_unwritten_pgoff(inode, SEEK_HOLE,533533- next, &offset))534534- goto out;535535-536536- offset = next;537537- if (ext[i].fe_flags & FIEMAP_EXTENT_LAST)538538- goto out;539535 }540540- }541541- if (offset > inode->i_size)542542- offset = inode->i_size;543543-out:544544- mutex_unlock(&inode->i_mutex);545545- if (ret)546546- return ret;547536548548- return vfs_setpos(file, offset, maxsize);537537+ /* find a hole */538538+ break;539539+ } while (last <= end);540540+541541+ mutex_unlock(&inode->i_mutex);542542+543543+ if (holeoff > isize)544544+ holeoff = isize;545545+546546+ return vfs_setpos(file, holeoff, maxsize);549547}550548551549/*
+12-12
fs/ext4/resize.c
···2424 return -EPERM;25252626 /*2727+ * If we are not using the primary superblock/GDT copy don't resize,2828+ * because the user tools have no way of handling this. Probably a2929+ * bad time to do it anyways.3030+ */3131+ if (EXT4_SB(sb)->s_sbh->b_blocknr !=3232+ le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) {3333+ ext4_warning(sb, "won't resize using backup superblock at %llu",3434+ (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr);3535+ return -EPERM;3636+ }3737+3838+ /*2739 * We are not allowed to do online-resizing on a filesystem mounted2840 * with error, because it can destroy the filesystem easily.2941 */···769757 printk(KERN_DEBUG770758 "EXT4-fs: ext4_add_new_gdb: adding group block %lu\n",771759 gdb_num);772772-773773- /*774774- * If we are not using the primary superblock/GDT copy don't resize,775775- * because the user tools have no way of handling this. Probably a776776- * bad time to do it anyways.777777- */778778- if (EXT4_SB(sb)->s_sbh->b_blocknr !=779779- le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) {780780- ext4_warning(sb, "won't resize using backup superblock at %llu",781781- (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr);782782- return -EPERM;783783- }784760785761 gdb_bh = sb_bread(sb, gdblock);786762 if (!gdb_bh)
+1-1
fs/ext4/super.c
···34823482 if (EXT4_HAS_RO_COMPAT_FEATURE(sb,34833483 EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) &&34843484 EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM))34853485- ext4_warning(sb, KERN_INFO "metadata_csum and uninit_bg are "34853485+ ext4_warning(sb, "metadata_csum and uninit_bg are "34863486 "redundant flags; please run fsck.");3487348734883488 /* Check for a known checksum algorithm */
+2-20
include/linux/mfd/stmpe.h
···5050 STMPE_IDX_GPEDR_MSB,5151 STMPE_IDX_GPRER_LSB,5252 STMPE_IDX_GPFER_LSB,5353+ STMPE_IDX_GPPUR_LSB,5454+ STMPE_IDX_GPPDR_LSB,5355 STMPE_IDX_GPAFR_U_MSB,5456 STMPE_IDX_IEGPIOR_LSB,5557 STMPE_IDX_ISGPIOR_LSB,···114112 enum stmpe_block block);115113extern int stmpe_enable(struct stmpe *stmpe, unsigned int blocks);116114extern int stmpe_disable(struct stmpe *stmpe, unsigned int blocks);117117-118118-struct matrix_keymap_data;119119-120120-/**121121- * struct stmpe_keypad_platform_data - STMPE keypad platform data122122- * @keymap_data: key map table and size123123- * @debounce_ms: debounce interval, in ms. Maximum is124124- * %STMPE_KEYPAD_MAX_DEBOUNCE.125125- * @scan_count: number of key scanning cycles to confirm key data.126126- * Maximum is %STMPE_KEYPAD_MAX_SCAN_COUNT.127127- * @no_autorepeat: disable key autorepeat128128- */129129-struct stmpe_keypad_platform_data {130130- const struct matrix_keymap_data *keymap_data;131131- unsigned int debounce_ms;132132- unsigned int scan_count;133133- bool no_autorepeat;134134-};135115136116#define STMPE_GPIO_NOREQ_811_TOUCH (0xf0)137117···183199 * @irq_gpio: gpio number over which irq will be requested (significant only if184200 * irq_over_gpio is true)185201 * @gpio: GPIO-specific platform data186186- * @keypad: keypad-specific platform data187202 * @ts: touchscreen-specific platform data188203 */189204struct stmpe_platform_data {···195212 int autosleep_timeout;196213197214 struct stmpe_gpio_platform_data *gpio;198198- struct stmpe_keypad_platform_data *keypad;199215 struct stmpe_ts_platform_data *ts;200216};201217
+1-1
include/linux/mm.h
···19521952#if VM_GROWSUP19531953extern int expand_upwards(struct vm_area_struct *vma, unsigned long address);19541954#else19551955- #define expand_upwards(vma, address) do { } while (0)19551955+ #define expand_upwards(vma, address) (0)19561956#endif1957195719581958/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */
+2-5
include/net/mac80211.h
···12701270 *12711271 * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the12721272 * driver to indicate that it requires IV generation for this12731273- * particular key. Setting this flag does not necessarily mean that SKBs12741274- * will have sufficient tailroom for ICV or MIC.12731273+ * particular key.12751274 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by12761275 * the driver for a TKIP key if it requires Michael MIC12771276 * generation in software.···12821283 * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver12831284 * if space should be prepared for the IV, but the IV12841285 * itself should not be generated. Do not set together with12851285- * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. Setting this flag does12861286- * not necessarily mean that SKBs will have sufficient tailroom for ICV or12871287- * MIC.12861286+ * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key.12881287 * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received12891288 * management frames. The flag can help drivers that have a hardware12901289 * crypto implementation that doesn't deal with management frames
+5-5
include/sound/pcm.h
···857857}858858859859/**860860- * params_channels - Get the sample rate from the hw params860860+ * params_rate - Get the sample rate from the hw params861861 * @p: hw params862862 */863863static inline unsigned int params_rate(const struct snd_pcm_hw_params *p)···866866}867867868868/**869869- * params_channels - Get the period size (in frames) from the hw params869869+ * params_period_size - Get the period size (in frames) from the hw params870870 * @p: hw params871871 */872872static inline unsigned int params_period_size(const struct snd_pcm_hw_params *p)···875875}876876877877/**878878- * params_channels - Get the number of periods from the hw params878878+ * params_periods - Get the number of periods from the hw params879879 * @p: hw params880880 */881881static inline unsigned int params_periods(const struct snd_pcm_hw_params *p)···884884}885885886886/**887887- * params_channels - Get the buffer size (in frames) from the hw params887887+ * params_buffer_size - Get the buffer size (in frames) from the hw params888888 * @p: hw params889889 */890890static inline unsigned int params_buffer_size(const struct snd_pcm_hw_params *p)···893893}894894895895/**896896- * params_channels - Get the buffer size (in bytes) from the hw params896896+ * params_buffer_bytes - Get the buffer size (in bytes) from the hw params897897 * @p: hw params898898 */899899static inline unsigned int params_buffer_bytes(const struct snd_pcm_hw_params *p)
+7
include/uapi/linux/virtio_ring.h
···101101 struct vring_used *used;102102};103103104104+/* Alignment requirements for vring elements.105105+ * When using pre-virtio 1.0 layout, these fall out naturally.106106+ */107107+#define VRING_AVAIL_ALIGN_SIZE 2108108+#define VRING_USED_ALIGN_SIZE 4109109+#define VRING_DESC_ALIGN_SIZE 16110110+104111/* The standard layout for the ring is a continuous chunk of memory which looks105112 * like this. We assume num is a power of 2.106113 *
+40-9
kernel/auditsc.c
···7272#include <linux/fs_struct.h>7373#include <linux/compat.h>7474#include <linux/ctype.h>7575+#include <linux/string.h>7676+#include <uapi/linux/limits.h>75777678#include "audit.h"7779···18631861 }1864186218651863 list_for_each_entry_reverse(n, &context->names_list, list) {18661866- /* does the name pointer match? */18671867- if (!n->name || n->name->name != name->name)18641864+ if (!n->name || strcmp(n->name->name, name->name))18681865 continue;1869186618701867 /* match the correct record type */···18821881 n = audit_alloc_name(context, AUDIT_TYPE_UNKNOWN);18831882 if (!n)18841883 return;18851885- if (name)18861886- /* since name is not NULL we know there is already a matching18871887- * name record, see audit_getname(), so there must be a type18881888- * mismatch; reuse the string path since the original name18891889- * record will keep the string valid until we free it in18901890- * audit_free_names() */18911891- n->name = name;18841884+ /* unfortunately, while we may have a path name to record with the18851885+ * inode, we can't always rely on the string lasting until the end of18861886+ * the syscall so we need to create our own copy, it may fail due to18871887+ * memory allocation issues, but we do our best */18881888+ if (name) {18891889+ /* we can't use getname_kernel() due to size limits */18901890+ size_t len = strlen(name->name) + 1;18911891+ struct filename *new = __getname();1892189218931893+ if (unlikely(!new))18941894+ goto out;18951895+18961896+ if (len <= (PATH_MAX - sizeof(*new))) {18971897+ new->name = (char *)(new) + sizeof(*new);18981898+ new->separate = false;18991899+ } else if (len <= PATH_MAX) {19001900+ /* this looks odd, but is due to final_putname() */19011901+ struct filename *new2;19021902+19031903+ new2 = kmalloc(sizeof(*new2), GFP_KERNEL);19041904+ if (unlikely(!new2)) {19051905+ __putname(new);19061906+ goto out;19071907+ }19081908+ new2->name = (char *)new;19091909+ new2->separate = true;19101910+ new = new2;19111911+ } else {19121912+ /* we should never get here, but let's be safe */19131913+ __putname(new);19141914+ goto out;19151915+ }19161916+ strlcpy((char *)new->name, name->name, len);19171917+ new->uptr = NULL;19181918+ new->aname = n;19191919+ n->name = new;19201920+ n->name_put = true;19211921+ }18931922out:18941923 if (parent) {18951924 n->name_len = n->name ? parent_len(n->name->name) : AUDIT_NAME_FULL;
···685685 if (orig_initialized)686686 atomic_dec(&bat_priv->mcast.num_disabled);687687 orig->capabilities |= BATADV_ORIG_CAPA_HAS_MCAST;688688- /* If mcast support is being switched off increase the disabled689689- * mcast node counter.688688+ /* If mcast support is being switched off or if this is an initial689689+ * OGM without mcast support then increase the disabled mcast690690+ * node counter.690691 */691692 } else if (!orig_mcast_enabled &&692692- orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) {693693+ (orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST ||694694+ !orig_initialized)) {693695 atomic_inc(&bat_priv->mcast.num_disabled);694696 orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_MCAST;695697 }···740738{741739 struct batadv_priv *bat_priv = orig->bat_priv;742740743743- if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST))741741+ if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) &&742742+ orig->capa_initialized & BATADV_ORIG_CAPA_HAS_MCAST)744743 atomic_dec(&bat_priv->mcast.num_disabled);745744746745 batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS);
+1-1
net/batman-adv/network-coding.c
···133133 if (!bat_priv->nc.decoding_hash)134134 goto err;135135136136- batadv_hash_set_lock_class(bat_priv->nc.coding_hash,136136+ batadv_hash_set_lock_class(bat_priv->nc.decoding_hash,137137 &batadv_nc_decoding_hash_lock_class_key);138138139139 INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker);
···443443444444 router = batadv_orig_router_get(orig_node, recv_if);445445446446+ if (!router)447447+ return router;448448+446449 /* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop)447450 * and if activated.448451 */449449- if (recv_if == BATADV_IF_DEFAULT || !atomic_read(&bat_priv->bonding) ||450450- !router)452452+ if (!(recv_if == BATADV_IF_DEFAULT && atomic_read(&bat_priv->bonding)))451453 return router;452454453455 /* bonding: loop through the list of possible routers found
+2-2
net/ipv4/tcp_output.c
···20192019 if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now)))20202020 break;2021202120222022- if (tso_segs == 1) {20222022+ if (tso_segs == 1 || !max_segs) {20232023 if (unlikely(!tcp_nagle_test(tp, skb, mss_now,20242024 (tcp_skb_is_last(sk, skb) ?20252025 nonagle : TCP_NAGLE_PUSH))))···20322032 }2033203320342034 limit = mss_now;20352035- if (tso_segs > 1 && !tcp_urg_mode(tp))20352035+ if (tso_segs > 1 && max_segs && !tcp_urg_mode(tp))20362036 limit = tcp_mss_split_point(sk, skb, mss_now,20372037 min_t(unsigned int,20382038 cwnd_quota,
+9-3
net/mac80211/key.c
···140140 if (!ret) {141141 key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE;142142143143- if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC))143143+ if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||144144+ (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) ||145145+ (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)))144146 sdata->crypto_tx_tailroom_needed_cnt--;145147146148 WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) &&···190188 sta = key->sta;191189 sdata = key->sdata;192190193193- if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC))191191+ if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||192192+ (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) ||193193+ (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)))194194 increment_tailroom_need_count(sdata);195195196196 ret = drv_set_key(key->local, DISABLE_KEY, sdata,···888884 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {889885 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;890886891891- if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC))887887+ if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||888888+ (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) ||889889+ (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE)))892890 increment_tailroom_need_count(key->sdata);893891 }894892
···175175 Most distributions have a CRDA package. So if unsure, say N.176176177177config CFG80211_WEXT178178- bool178178+ bool "cfg80211 wireless extensions compatibility"179179 depends on CFG80211180180 select WEXT_CORE181181 help