···4646void imx_cpu_die(unsigned int cpu)4747{4848 cpu_enter_lowpower();4949+ /*5050+ * We use the cpu jumping argument register to sync with5151+ * imx_cpu_kill() which is running on cpu0 and waiting for5252+ * the register being cleared to kill the cpu.5353+ */5454+ imx_set_cpu_arg(cpu, ~0);4955 cpu_do_idle();5056}51575258int imx_cpu_kill(unsigned int cpu)5359{6060+ unsigned long timeout = jiffies + msecs_to_jiffies(50);6161+6262+ while (imx_get_cpu_arg(cpu) == 0)6363+ if (time_after(jiffies, timeout))6464+ return 0;5465 imx_enable_cpu(cpu, false);6666+ imx_set_cpu_arg(cpu, 0);5567 return 1;5668}
+12
arch/arm/mach-imx/src.c
···4343 src_base + SRC_GPR1 + cpu * 8);4444}45454646+u32 imx_get_cpu_arg(int cpu)4747+{4848+ cpu = cpu_logical_map(cpu);4949+ return readl_relaxed(src_base + SRC_GPR1 + cpu * 8 + 4);5050+}5151+5252+void imx_set_cpu_arg(int cpu, u32 arg)5353+{5454+ cpu = cpu_logical_map(cpu);5555+ writel_relaxed(arg, src_base + SRC_GPR1 + cpu * 8 + 4);5656+}5757+4658void imx_src_prepare_restart(void)4759{4860 u32 val;
+2
arch/arm/mach-kirkwood/guruplug-setup.c
···53535454static struct mvsdio_platform_data guruplug_mvsdio_data = {5555 /* unfortunately the CD signal has not been connected */5656+ .gpio_card_detect = -1,5757+ .gpio_write_protect = -1,5658};57595860static struct gpio_led guruplug_led_pins[] = {
+1
arch/arm/mach-kirkwood/openrd-setup.c
···55555656static struct mvsdio_platform_data openrd_mvsdio_data = {5757 .gpio_card_detect = 29, /* MPP29 used as SD card detect */5858+ .gpio_write_protect = -1,5859};59606061static unsigned int openrd_mpp_config[] __initdata = {
···5252 */5353#define OMAP4_DPLL_ABE_DEFFREQ 9830400054545555+/*5656+ * OMAP4 USB DPLL default frequency. In OMAP4430 TRM version V, section5757+ * "3.6.3.9.5 DPLL_USB Preferred Settings" shows that the preferred5858+ * locked frequency for the USB DPLL is 960MHz.5959+ */6060+#define OMAP4_DPLL_USB_DEFFREQ 9600000006161+5562/* Root clocks */56635764DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0);···10181011 OMAP4430_CM_L3INIT_MMC2_CLKCTRL, OMAP4430_CLKSEL_MASK,10191012 hsmmc1_fclk_parents, func_dmic_abe_gfclk_ops);1020101310141014+DEFINE_CLK_GATE(ocp2scp_usb_phy_phy_48m, "func_48m_fclk", &func_48m_fclk, 0x0,10151015+ OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,10161016+ OMAP4430_OPTFCLKEN_PHY_48M_SHIFT, 0x0, NULL);10171017+10211018DEFINE_CLK_GATE(sha2md5_fck, "l3_div_ck", &l3_div_ck, 0x0,10221019 OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL,10231020 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);···15491538 CLK(NULL, "per_mcbsp4_gfclk", &per_mcbsp4_gfclk, CK_443X),15501539 CLK(NULL, "hsmmc1_fclk", &hsmmc1_fclk, CK_443X),15511540 CLK(NULL, "hsmmc2_fclk", &hsmmc2_fclk, CK_443X),15411541+ CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X),15521542 CLK(NULL, "sha2md5_fck", &sha2md5_fck, CK_443X),15531543 CLK(NULL, "slimbus1_fclk_1", &slimbus1_fclk_1, CK_443X),15541544 CLK(NULL, "slimbus1_fclk_0", &slimbus1_fclk_0, CK_443X),···17161704 rc = clk_set_rate(&dpll_abe_ck, OMAP4_DPLL_ABE_DEFFREQ);17171705 if (rc)17181706 pr_err("%s: failed to configure ABE DPLL!\n", __func__);17071707+17081708+ /*17091709+ * Lock USB DPLL on OMAP4 devices so that the L3INIT power17101710+ * domain can transition to retention state when not in use.17111711+ */17121712+ rc = clk_set_rate(&dpll_usb_ck, OMAP4_DPLL_USB_DEFFREQ);17131713+ if (rc)17141714+ pr_err("%s: failed to configure USB DPLL!\n", __func__);1719171517201716 return 0;17211717}
+3
arch/arm/mach-omap2/common.h
···293293struct omap_hwmod;294294extern int omap_dss_reset(struct omap_hwmod *);295295296296+/* SoC specific clock initializer */297297+extern int (*omap_clk_init)(void);298298+296299#endif /* __ASSEMBLER__ */297300#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
+12-6
arch/arm/mach-omap2/io.c
···5555#include "prm44xx.h"56565757/*5858+ * omap_clk_init: points to a function that does the SoC-specific5959+ * clock initializations6060+ */6161+int (*omap_clk_init)(void);6262+6363+/*5864 * The machine specific code may provide the extra mapping besides the5965 * default mapping provided here.6066 */···403397 omap242x_clockdomains_init();404398 omap2420_hwmod_init();405399 omap_hwmod_init_postsetup();406406- omap2420_clk_init();400400+ omap_clk_init = omap2420_clk_init;407401}408402409403void __init omap2420_init_late(void)···433427 omap243x_clockdomains_init();434428 omap2430_hwmod_init();435429 omap_hwmod_init_postsetup();436436- omap2430_clk_init();430430+ omap_clk_init = omap2430_clk_init;437431}438432439433void __init omap2430_init_late(void)···468462 omap3xxx_clockdomains_init();469463 omap3xxx_hwmod_init();470464 omap_hwmod_init_postsetup();471471- omap3xxx_clk_init();465465+ omap_clk_init = omap3xxx_clk_init;472466}473467474468void __init omap3430_init_early(void)···506500 omap3xxx_clockdomains_init();507501 omap3xxx_hwmod_init();508502 omap_hwmod_init_postsetup();509509- omap3xxx_clk_init();503503+ omap_clk_init = omap3xxx_clk_init;510504}511505512506void __init omap3_init_late(void)···574568 am33xx_clockdomains_init();575569 am33xx_hwmod_init();576570 omap_hwmod_init_postsetup();577577- am33xx_clk_init();571571+ omap_clk_init = am33xx_clk_init;578572}579573#endif580574···599593 omap44xx_clockdomains_init();600594 omap44xx_hwmod_init();601595 omap_hwmod_init_postsetup();602602- omap4xxx_clk_init();596596+ omap_clk_init = omap4xxx_clk_init;603597}604598605599void __init omap4430_init_late(void)
+5-2
arch/arm/mach-omap2/omap_hwmod.c
···13681368 }1369136913701370 if (sf & SYSC_HAS_MIDLEMODE) {13711371- if (oh->flags & HWMOD_SWSUP_MSTANDBY) {13711371+ if (oh->flags & HWMOD_FORCE_MSTANDBY) {13721372+ idlemode = HWMOD_IDLEMODE_FORCE;13731373+ } else if (oh->flags & HWMOD_SWSUP_MSTANDBY) {13721374 idlemode = HWMOD_IDLEMODE_NO;13731375 } else {13741376 if (sf & SYSC_HAS_ENAWAKEUP)···14421440 }1443144114441442 if (sf & SYSC_HAS_MIDLEMODE) {14451445- if (oh->flags & HWMOD_SWSUP_MSTANDBY) {14431443+ if ((oh->flags & HWMOD_SWSUP_MSTANDBY) ||14441444+ (oh->flags & HWMOD_FORCE_MSTANDBY)) {14461445 idlemode = HWMOD_IDLEMODE_FORCE;14471446 } else {14481447 if (sf & SYSC_HAS_ENAWAKEUP)
+7-2
arch/arm/mach-omap2/omap_hwmod.h
···427427 *428428 * HWMOD_SWSUP_SIDLE: omap_hwmod code should manually bring module in and out429429 * of idle, rather than relying on module smart-idle430430- * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out431431- * of standby, rather than relying on module smart-standby430430+ * HWMOD_SWSUP_MSTANDBY: omap_hwmod code should manually bring module in and431431+ * out of standby, rather than relying on module smart-standby432432 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for433433 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file434434 * XXX Should be HWMOD_SETUP_NO_RESET···459459 * correctly, or this is being abused to deal with some PM latency460460 * issues -- but we're currently suffering from a shortage of461461 * folks who are able to track these issues down properly.462462+ * HWMOD_FORCE_MSTANDBY: Always keep MIDLEMODE bits cleared so that device463463+ * is kept in force-standby mode. Failing to do so causes PM problems464464+ * with musb on OMAP3630 at least. Note that musb has a dedicated register465465+ * to control MSTANDBY signal when MIDLEMODE is set to force-standby.462466 */463467#define HWMOD_SWSUP_SIDLE (1 << 0)464468#define HWMOD_SWSUP_MSTANDBY (1 << 1)···475471#define HWMOD_16BIT_REG (1 << 8)476472#define HWMOD_EXT_OPT_MAIN_CLK (1 << 9)477473#define HWMOD_BLOCK_WFI (1 << 10)474474+#define HWMOD_FORCE_MSTANDBY (1 << 11)478475479476/*480477 * omap_hwmod._int_flags definitions
+6-1
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
···17071707 * Erratum ID: i479 idle_req / idle_ack mechanism potentially17081708 * broken when autoidle is enabled17091709 * workaround is to disable the autoidle bit at module level.17101710+ *17111711+ * Enabling the device in any other MIDLEMODE setting but force-idle17121712+ * causes core_pwrdm not enter idle states at least on OMAP3630.17131713+ * Note that musb has OTG_FORCESTDBY register that controls MSTANDBY17141714+ * signal when MIDLEMODE is set to force-idle.17101715 */17111716 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE17121712- | HWMOD_SWSUP_MSTANDBY,17171717+ | HWMOD_FORCE_MSTANDBY,17131718};1714171917151720/* usb_otg_hs */
···312312 /* Pinmaps must be in place before devices register */313313 if (of_machine_is_compatible("st-ericsson,mop500"))314314 mop500_pinmaps_init();315315- else if (of_machine_is_compatible("calaosystems,snowball-a9500"))315315+ else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {316316 snowball_pinmaps_init();317317- else if (of_machine_is_compatible("st-ericsson,hrefv60+"))317317+ mop500_snowball_ethernet_clock_enable();318318+ } else if (of_machine_is_compatible("st-ericsson,hrefv60+"))318319 hrefv60_pinmaps_init();319320 else if (of_machine_is_compatible("st-ericsson,ccu9540")) {}320321 /* TODO: Add pinmaps for ccu9540 board. */
···99 *1010 * Initialized the local nvram copy from the target address and checks1111 * its checksum.1212- *1313- * Returns 0 on success.1412 */1515-int __init bcm63xx_nvram_init(void *nvram);1313+void bcm63xx_nvram_init(void *nvram);16141715/**1816 * bcm63xx_nvram_get_name() - returns the board name according to nvram
···100100obj-$(CONFIG_JUMP_LABEL) += jump_label.o101101102102#103103-# DSP ASE supported for MIPS32 or MIPS64 Release 2 cores only. It is safe104104-# to enable DSP assembler support here even if the MIPS Release 2 CPU we105105-# are targetting does not support DSP because all code-paths making use of106106-# it properly check that the running CPU *actually does* support these107107-# instructions.103103+# DSP ASE supported for MIPS32 or MIPS64 Release 2 cores only. It is not104104+# safe to unconditionnaly use the assembler -mdsp / -mdspr2 switches105105+# here because the compiler may use DSP ASE instructions (such as lwx) in106106+# code paths where we cannot check that the CPU we are running on supports it.107107+# Proper abstraction using HAVE_AS_DSP and macros is done in108108+# arch/mips/include/asm/mipsregs.h.108109#109110ifeq ($(CONFIG_CPU_MIPSR2), y)110111CFLAGS_DSP = -DHAVE_AS_DSP111111-112112-#113113-# Check if assembler supports DSP ASE114114-#115115-ifeq ($(call cc-option-yn,-mdsp), y)116116-CFLAGS_DSP += -mdsp117117-endif118118-119119-#120120-# Check if assembler supports DSP ASE Rev2121121-#122122-ifeq ($(call cc-option-yn,-mdspr2), y)123123-CFLAGS_DSP += -mdspr2124124-endif125112126113CFLAGS_signal.o = $(CFLAGS_DSP)127114CFLAGS_signal32.o = $(CFLAGS_DSP)
···6767 if (cpu_has_mips_r) {6868 seq_printf(m, "isa\t\t\t:");6969 if (cpu_has_mips_1)7070- seq_printf(m, "%s", "mips1");7070+ seq_printf(m, "%s", " mips1");7171 if (cpu_has_mips_2)7272 seq_printf(m, "%s", " mips2");7373 if (cpu_has_mips_3)
+8-8
arch/mips/lib/bitops.c
···9090 unsigned bit = nr & SZLONG_MASK;9191 unsigned long mask;9292 unsigned long flags;9393- unsigned long res;9393+ int res;94949595 a += nr >> SZLONG_LOG;9696 mask = 1UL << bit;9797 raw_local_irq_save(flags);9898- res = (mask & *a);9898+ res = (mask & *a) != 0;9999 *a |= mask;100100 raw_local_irq_restore(flags);101101 return res;···116116 unsigned bit = nr & SZLONG_MASK;117117 unsigned long mask;118118 unsigned long flags;119119- unsigned long res;119119+ int res;120120121121 a += nr >> SZLONG_LOG;122122 mask = 1UL << bit;123123 raw_local_irq_save(flags);124124- res = (mask & *a);124124+ res = (mask & *a) != 0;125125 *a |= mask;126126 raw_local_irq_restore(flags);127127 return res;···141141 unsigned bit = nr & SZLONG_MASK;142142 unsigned long mask;143143 unsigned long flags;144144- unsigned long res;144144+ int res;145145146146 a += nr >> SZLONG_LOG;147147 mask = 1UL << bit;148148 raw_local_irq_save(flags);149149- res = (mask & *a);149149+ res = (mask & *a) != 0;150150 *a &= ~mask;151151 raw_local_irq_restore(flags);152152 return res;···166166 unsigned bit = nr & SZLONG_MASK;167167 unsigned long mask;168168 unsigned long flags;169169- unsigned long res;169169+ int res;170170171171 a += nr >> SZLONG_LOG;172172 mask = 1UL << bit;173173 raw_local_irq_save(flags);174174- res = (mask & *a);174174+ res = (mask & *a) != 0;175175 *a ^= mask;176176 raw_local_irq_restore(flags);177177 return res;
···398398 base = 0;399399400400 if (max < rbnode->base_reg + rbnode->blklen)401401- end = rbnode->base_reg + rbnode->blklen - max;401401+ end = max - rbnode->base_reg + 1;402402 else403403 end = rbnode->blklen;404404
+5-4
drivers/base/regmap/regmap.c
···710710 }711711 }712712713713+ regmap_debugfs_init(map, config->name);714714+713715 ret = regcache_init(map, config);714716 if (ret != 0)715717 goto err_range;716716-717717- regmap_debugfs_init(map, config->name);718718719719 /* Add a devres resource for dev_get_regmap() */720720 m = devres_alloc(dev_get_regmap_release, sizeof(*m), GFP_KERNEL);···943943 unsigned int ival;944944 int val_bytes = map->format.val_bytes;945945 for (i = 0; i < val_len / val_bytes; i++) {946946- memcpy(map->work_buf, val + (i * val_bytes), val_bytes);947947- ival = map->format.parse_val(map->work_buf);946946+ ival = map->format.parse_val(val + (i * val_bytes));948947 ret = regcache_write(map, reg + (i * map->reg_stride),949948 ival);950949 if (ret) {···10351036 kfree(async->work_buf);10361037 kfree(async);10371038 }10391039+10401040+ return ret;10381041 }1039104210401043 trace_regmap_hw_write_start(map->dev, reg,
+8-1
drivers/block/loop.c
···922922 lo->lo_flags |= LO_FLAGS_PARTSCAN;923923 if (lo->lo_flags & LO_FLAGS_PARTSCAN)924924 ioctl_by_bdev(bdev, BLKRRPART, 0);925925+926926+ /* Grab the block_device to prevent its destruction after we927927+ * put /dev/loopXX inode. Later in loop_clr_fd() we bdput(bdev).928928+ */929929+ bdgrab(bdev);925930 return 0;926931927932out_clr:···10361031 memset(lo->lo_encrypt_key, 0, LO_KEY_SIZE);10371032 memset(lo->lo_crypt_name, 0, LO_NAME_SIZE);10381033 memset(lo->lo_file_name, 0, LO_NAME_SIZE);10391039- if (bdev)10341034+ if (bdev) {10351035+ bdput(bdev);10401036 invalidate_bdev(bdev);10371037+ }10411038 set_capacity(lo->lo_disk, 0);10421039 loop_sysfs_exit(lo);10431040 if (bdev) {
+9
drivers/char/hw_random/core.c
···380380}381381EXPORT_SYMBOL_GPL(hwrng_unregister);382382383383+static void __exit hwrng_exit(void)384384+{385385+ mutex_lock(&rng_mutex);386386+ BUG_ON(current_rng);387387+ kfree(rng_buffer);388388+ mutex_unlock(&rng_mutex);389389+}390390+391391+module_exit(hwrng_exit);383392384393MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver");385394MODULE_LICENSE("GPL");
+30-14
drivers/char/virtio_console.c
···149149 spinlock_t ports_lock;150150151151 /* To protect the vq operations for the control channel */152152- spinlock_t cvq_lock;152152+ spinlock_t c_ivq_lock;153153+ spinlock_t c_ovq_lock;153154154155 /* The current config space is stored here */155156 struct virtio_console_config config;···570569 vq = portdev->c_ovq;571570572571 sg_init_one(sg, &cpkt, sizeof(cpkt));572572+573573+ spin_lock(&portdev->c_ovq_lock);573574 if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt, GFP_ATOMIC) == 0) {574575 virtqueue_kick(vq);575576 while (!virtqueue_get_buf(vq, &len))576577 cpu_relax();577578 }579579+ spin_unlock(&portdev->c_ovq_lock);578580 return 0;579581}580582···14401436 * rproc_serial does not want the console port, only14411437 * the generic port implementation.14421438 */14431443- port->host_connected = port->guest_connected = true;14391439+ port->host_connected = true;14441440 else if (!use_multiport(port->portdev)) {14451441 /*14461442 * If we're not using multiport support,···17131709 portdev = container_of(work, struct ports_device, control_work);17141710 vq = portdev->c_ivq;1715171117161716- spin_lock(&portdev->cvq_lock);17121712+ spin_lock(&portdev->c_ivq_lock);17171713 while ((buf = virtqueue_get_buf(vq, &len))) {17181718- spin_unlock(&portdev->cvq_lock);17141714+ spin_unlock(&portdev->c_ivq_lock);1719171517201716 buf->len = len;17211717 buf->offset = 0;1722171817231719 handle_control_message(portdev, buf);1724172017251725- spin_lock(&portdev->cvq_lock);17211721+ spin_lock(&portdev->c_ivq_lock);17261722 if (add_inbuf(portdev->c_ivq, buf) < 0) {17271723 dev_warn(&portdev->vdev->dev,17281724 "Error adding buffer to queue\n");17291725 free_buf(buf, false);17301726 }17311727 }17321732- spin_unlock(&portdev->cvq_lock);17281728+ spin_unlock(&portdev->c_ivq_lock);17331729}1734173017351731static void out_intr(struct virtqueue *vq)···17561752 port->inbuf = get_inbuf(port);1757175317581754 /*17591759- * Don't queue up data when port is closed. This condition17551755+ * Normally the port should not accept data when the port is17561756+ * closed. For generic serial ports, the host won't (shouldn't)17571757+ * send data till the guest is connected. But this condition17601758 * can be reached when a console port is not yet connected (no17611761- * tty is spawned) and the host sends out data to console17621762- * ports. For generic serial ports, the host won't17631763- * (shouldn't) send data till the guest is connected.17591759+ * tty is spawned) and the other side sends out data over the17601760+ * vring, or when a remote devices start sending data before17611761+ * the ports are opened.17621762+ *17631763+ * A generic serial port will discard data if not connected,17641764+ * while console ports and rproc-serial ports accepts data at17651765+ * any time. rproc-serial is initiated with guest_connected to17661766+ * false because port_fops_open expects this. Console ports are17671767+ * hooked up with an HVC console and is initialized with17681768+ * guest_connected to true.17641769 */17651765- if (!port->guest_connected)17701770+17711771+ if (!port->guest_connected && !is_rproc_serial(port->portdev->vdev))17661772 discard_port_data(port);1767177317681774 spin_unlock_irqrestore(&port->inbuf_lock, flags);···20001986 if (multiport) {20011987 unsigned int nr_added_bufs;2002198820032003- spin_lock_init(&portdev->cvq_lock);19891989+ spin_lock_init(&portdev->c_ivq_lock);19901990+ spin_lock_init(&portdev->c_ovq_lock);20041991 INIT_WORK(&portdev->control_work, &control_work_handler);2005199220062006- nr_added_bufs = fill_queue(portdev->c_ivq, &portdev->cvq_lock);19931993+ nr_added_bufs = fill_queue(portdev->c_ivq,19941994+ &portdev->c_ivq_lock);20071995 if (!nr_added_bufs) {20081996 dev_err(&vdev->dev,20091997 "Error allocating buffers for control queue\n");···21562140 return ret;2157214121582142 if (use_multiport(portdev))21592159- fill_queue(portdev->c_ivq, &portdev->cvq_lock);21432143+ fill_queue(portdev->c_ivq, &portdev->c_ivq_lock);2160214421612145 list_for_each_entry(port, &portdev->ports, list) {21622146 port->in_vq = portdev->in_vqs[port->id];
···19751975 return -EINVAL;19761976 }1977197719781978+ write_unlock_bh(&bond->lock);19781979 /* unregister rx_handler early so bond_handle_frame wouldn't be called19791980 * for this slave anymore.19801981 */19811982 netdev_rx_handler_unregister(slave_dev);19821982- write_unlock_bh(&bond->lock);19831983- synchronize_net();19841983 write_lock_bh(&bond->lock);1985198419861985 if (!all && !bond->params.fail_over_mac) {
+2-2
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
···411411412412static void mlx4_en_u64_to_mac(unsigned char dst_mac[ETH_ALEN + 2], u64 src_mac)413413{414414- unsigned int i;415415- for (i = ETH_ALEN - 1; i; --i) {414414+ int i;415415+ for (i = ETH_ALEN - 1; i >= 0; --i) {416416 dst_mac[i] = src_mac & 0xff;417417 src_mac >>= 8;418418 }
···28152815}2816281628172817/**28182818+ * fcoe_ctlr_mode_set() - Set or reset the ctlr's mode28192819+ * @lport: The local port to be (re)configured28202820+ * @fip: The FCoE controller whose mode is changing28212821+ * @fip_mode: The new fip mode28222822+ *28232823+ * Note that the we shouldn't be changing the libfc discovery settings28242824+ * (fc_disc_config) while an lport is going through the libfc state28252825+ * machine. The mode can only be changed when a fcoe_ctlr device is28262826+ * disabled, so that should ensure that this routine is only called28272827+ * when nothing is happening.28282828+ */28292829+void fcoe_ctlr_mode_set(struct fc_lport *lport, struct fcoe_ctlr *fip,28302830+ enum fip_state fip_mode)28312831+{28322832+ void *priv;28332833+28342834+ WARN_ON(lport->state != LPORT_ST_RESET &&28352835+ lport->state != LPORT_ST_DISABLED);28362836+28372837+ if (fip_mode == FIP_MODE_VN2VN) {28382838+ lport->rport_priv_size = sizeof(struct fcoe_rport);28392839+ lport->point_to_multipoint = 1;28402840+ lport->tt.disc_recv_req = fcoe_ctlr_disc_recv;28412841+ lport->tt.disc_start = fcoe_ctlr_disc_start;28422842+ lport->tt.disc_stop = fcoe_ctlr_disc_stop;28432843+ lport->tt.disc_stop_final = fcoe_ctlr_disc_stop_final;28442844+ priv = fip;28452845+ } else {28462846+ lport->rport_priv_size = 0;28472847+ lport->point_to_multipoint = 0;28482848+ lport->tt.disc_recv_req = NULL;28492849+ lport->tt.disc_start = NULL;28502850+ lport->tt.disc_stop = NULL;28512851+ lport->tt.disc_stop_final = NULL;28522852+ priv = lport;28532853+ }28542854+28552855+ fc_disc_config(lport, priv);28562856+}28572857+28582858+/**28182859 * fcoe_libfc_config() - Sets up libfc related properties for local port28192860 * @lport: The local port to configure libfc for28202861 * @fip: The FCoE controller in use by the local port···28742833 fc_exch_init(lport);28752834 fc_elsct_init(lport);28762835 fc_lport_init(lport);28772877- if (fip->mode == FIP_MODE_VN2VN)28782878- lport->rport_priv_size = sizeof(struct fcoe_rport);28792836 fc_rport_init(lport);28802880- if (fip->mode == FIP_MODE_VN2VN) {28812881- lport->point_to_multipoint = 1;28822882- lport->tt.disc_recv_req = fcoe_ctlr_disc_recv;28832883- lport->tt.disc_start = fcoe_ctlr_disc_start;28842884- lport->tt.disc_stop = fcoe_ctlr_disc_stop;28852885- lport->tt.disc_stop_final = fcoe_ctlr_disc_stop_final;28862886- mutex_init(&lport->disc.disc_mutex);28872887- INIT_LIST_HEAD(&lport->disc.rports);28882888- lport->disc.priv = fip;28892889- } else {28902890- fc_disc_init(lport);28912891- }28372837+ fc_disc_init(lport);28382838+ fcoe_ctlr_mode_set(lport, fip, fip->mode);28922839 return 0;28932840}28942841EXPORT_SYMBOL_GPL(fcoe_libfc_config);···29042875void fcoe_ctlr_set_fip_mode(struct fcoe_ctlr_device *ctlr_dev)29052876{29062877 struct fcoe_ctlr *ctlr = fcoe_ctlr_device_priv(ctlr_dev);28782878+ struct fc_lport *lport = ctlr->lp;2907287929082880 mutex_lock(&ctlr->ctlr_mutex);29092881 switch (ctlr_dev->mode) {···29182888 }2919288929202890 mutex_unlock(&ctlr->ctlr_mutex);28912891+28922892+ fcoe_ctlr_mode_set(lport, ctlr, ctlr->mode);29212893}29222894EXPORT_SYMBOL(fcoe_ctlr_set_fip_mode);
+18-8
drivers/scsi/libfc/fc_disc.c
···712712}713713714714/**715715- * fc_disc_init() - Initialize the discovery layer for a local port716716- * @lport: The local port that needs the discovery layer to be initialized715715+ * fc_disc_config() - Configure the discovery layer for a local port716716+ * @lport: The local port that needs the discovery layer to be configured717717+ * @priv: Private data structre for users of the discovery layer717718 */718718-int fc_disc_init(struct fc_lport *lport)719719+void fc_disc_config(struct fc_lport *lport, void *priv)719720{720720- struct fc_disc *disc;721721+ struct fc_disc *disc = &lport->disc;721722722723 if (!lport->tt.disc_start)723724 lport->tt.disc_start = fc_disc_start;···733732 lport->tt.disc_recv_req = fc_disc_recv_req;734733735734 disc = &lport->disc;735735+736736+ disc->priv = priv;737737+}738738+EXPORT_SYMBOL(fc_disc_config);739739+740740+/**741741+ * fc_disc_init() - Initialize the discovery layer for a local port742742+ * @lport: The local port that needs the discovery layer to be initialized743743+ */744744+void fc_disc_init(struct fc_lport *lport)745745+{746746+ struct fc_disc *disc = &lport->disc;747747+736748 INIT_DELAYED_WORK(&disc->disc_work, fc_disc_timeout);737749 mutex_init(&disc->disc_mutex);738750 INIT_LIST_HEAD(&disc->rports);739739-740740- disc->priv = lport;741741-742742- return 0;743751}744752EXPORT_SYMBOL(fc_disc_init);