Merge android-4.14-stable (4.14.281) into android-msm-pixel-4.14-tm-lts
Merge 4.14.281 into android-4.14-stable
Linux 4.14.281
* Reinstate some of "swiotlb: rework "fix info leak with DMA_FROM_DEVICE""
include/linux/dma-mapping.h
lib/swiotlb.c
* swiotlb: fix info leak with DMA_FROM_DEVICE
include/linux/dma-mapping.h
lib/swiotlb.c
net: atlantic: verify hw_head_ lies within TX buffer ring
net: stmmac: fix missing pci_disable_device() on error in stmmac_pci_probe()
ethernet: tulip: fix missing pci_disable_device() on error in tulip_init_one()
mac80211: fix rx reordering with non explicit / psmp ack policy
scsi: qla2xxx: Fix missed DMA unmap for aborted commands
perf bench numa: Address compiler error on s390
gpio: mvebu/pwm: Refuse requests with inverted polarity
gpio: gpio-vf610: do not touch other bits when set the target bit
* net: bridge: Clear offload_fwd_mark when passing frame up bridge interface.
net/bridge/br_input.c
igb: skip phy status check where unavailable
ARM: 9197/1: spectre-bhb: fix loop8 sequence for Thumb2
ARM: 9196/1: spectre-bhb: enable for Cortex-A15
* net: af_key: add check for pfkey_broadcast in function pfkey_process
net/key/af_key.c
NFC: nci: fix sleep in atomic context bugs caused by nci_skb_alloc
net/qla3xxx: Fix a test in ql_reset_work()
clk: at91: generated: consider range when calculating best rate
net: vmxnet3: fix possible NULL pointer dereference in vmxnet3_rq_cleanup()
net: vmxnet3: fix possible use-after-free bugs in vmxnet3_rq_alloc_rx_buf()
mmc: core: Default to generic_cmd6_time as timeout in __mmc_switch()
mmc: block: Use generic_cmd6_time when modifying INAND_CMD38_ARG_EXT_CSD
mmc: core: Specify timeouts for BKOPS and CACHE_FLUSH for eMMC
* drm/dp/mst: fix a possible memory leak in fetch_monitor_name()
drivers/gpu/drm/drm_dp_mst_topology.c
* perf: Fix sys_perf_event_open() race against self
kernel/events/core.c
ALSA: wavefront: Proper check of get_user() error
ARM: 9191/1: arm/stacktrace, kasan: Silence KASAN warnings in unwind_frame()
drbd: remove usage of list iterator variable after loop
MIPS: lantiq: check the return value of kzalloc()
Input: stmfts - fix reference leak in stmfts_input_open
* Input: add bounds checking to input_set_capability()
drivers/input/input.c
um: Cleanup syscall_handler_t definition/cast, fix warning
floppy: use a statically allocated error counter
Merge 4.14.280 into android-4.14-stable
Linux 4.14.280
tty/serial: digicolor: fix possible null-ptr-deref in digicolor_uart_probe()
* ping: fix address binding wrt vrf
net/ipv4/ping.c
drm/vmwgfx: Initialize drm_mode_fb_cmd2
* cgroup/cpuset: Remove cpus_allowed/mems_allowed setup in cpuset_init_smp()
kernel/cgroup/cpuset.c
USB: serial: option: add Fibocom MA510 modem
USB: serial: option: add Fibocom L610 modem
USB: serial: qcserial: add support for Sierra Wireless EM7590
USB: serial: pl2303: add device id for HP LM930 Display
usb: cdc-wdm: fix reading stuck on device close
* tcp: resalt the secret every 10 seconds
net/core/secure_seq.c
* ASoC: ops: Validate input values in snd_soc_put_volsw_range()
sound/soc/soc-ops.c
ASoC: max98090: Generate notifications on changes for custom control
ASoC: max98090: Reject invalid values in custom control put()
hwmon: (f71882fg) Fix negative temperature
net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe()
net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending
s390/lcs: fix variable dereferenced before check
s390/ctcm: fix potential memory leak
s390/ctcm: fix variable dereferenced before check
* hwmon: (ltq-cputemp) restrict it to SOC_XWAY
drivers/hwmon/Kconfig
mac80211_hwsim: call ieee80211_tx_prepare_skb under RCU protection
* netlink: do not reset transport header in netlink_recvmsg()
net/netlink/af_netlink.c
* ipv4: drop dst in multicast routing path
net/ipv4/route.c
* net: Fix features skip in for_each_netdev_feature()
include/linux/netdev_features.h
batman-adv: Don't skb_split skbuffs with frag_list
Merge 4.14.279 into android-4.14-stable
Linux 4.14.279
* VFS: Fix memory leak caused by concurrently mounting fs with subtype
fs/namespace.c
* ALSA: pcm: Fix potential AB/BA lock with buffer_mutex and mmap_lock
include/sound/pcm.h
sound/core/pcm.c
sound/core/pcm_lib.c
sound/core/pcm_native.c
* ALSA: pcm: Fix races among concurrent prealloc proc writes
sound/core/pcm_memory.c
* ALSA: pcm: Fix races among concurrent prepare and hw_params/hw_free calls
sound/core/pcm_native.c
* ALSA: pcm: Fix races among concurrent read/write and buffer changes
sound/core/pcm_lib.c
* ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
include/sound/pcm.h
sound/core/pcm.c
sound/core/pcm_native.c
mm: userfaultfd: fix missing cache flush in mcopy_atomic_pte() and __mcopy_atomic()
* mm: hugetlb: fix missing cache flush in copy_huge_page_from_user()
mm/memory.c
mmc: rtsx: add 74 Clocks in power on flow
* Bluetooth: Fix the creation of hdev->name
include/net/bluetooth/hci_core.h
net/bluetooth/hci_core.c
can: grcan: only use the NAPI poll budget for RX
can: grcan: grcan_probe(): fix broken system id check for errata workaround needs
block: drbd: drbd_nl: Make conversion to 'enum drbd_ret_code' explicit
MIPS: Use address-of operator on section symbols
Merge 4.14.278 into android-4.14-stable
Linux 4.14.278
PCI: aardvark: Fix reading MSI interrupt number
PCI: aardvark: Clear all MSIs at setup
* dm: interlock pending dm_io and dm_wait_for_bios_completion
drivers/md/dm.c
* dm: fix mempool NULL pointer race when completing IO
drivers/md/dm.c
* net: ipv6: ensure we call ipv6_mc_down() at most once
net/ipv6/addrconf.c
kvm: x86/cpuid: Only provide CPUID leaf 0xA if host has architectural PMU
* net: igmp: respect RCU rules in ip_mc_source() and ip_mc_msfilter()
net/ipv4/igmp.c
btrfs: always log symlinks in full mode
smsc911x: allow using IRQ0
net: emaclite: Add error handling for of_address_to_resource()
ASoC: dmaengine: Restore NULL prepare_slave_config() callback
hwmon: (adt7470) Fix warning on module removal
NFC: netlink: fix sleep in atomic bug when firmware download timeout
nfc: nfcmrvl: main: reorder destructive operations in nfcmrvl_nci_unregister_dev to avoid bugs
nfc: replace improper check device_is_registered() in netlink related functions
can: grcan: use ofdev->dev when allocating DMA memory
can: grcan: grcan_close(): fix deadlock
ASoC: wm8958: Fix change notifications for DSP controls
firewire: core: extend card->lock in fw_core_handle_bus_reset
firewire: remove check of list iterator against head past the loop body
firewire: fix potential uaf in outbound_phy_packet_callback()
Revert "SUNRPC: attempt AF_LOCAL connect on setup"
ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes
parisc: Merge model and model name into one line in /proc/cpuinfo
MIPS: Fix CP0 counter erratum detection for R4k CPUs
drm/vgem: Close use-after-free race in vgem_gem_create
tty: n_gsm: fix incorrect UA handling
tty: n_gsm: fix wrong command frame length field encoding
tty: n_gsm: fix wrong command retry handling
tty: n_gsm: fix missing explicit ldisc flush
tty: n_gsm: fix insufficient txframe size
tty: n_gsm: fix malformed counter for out of frame data
tty: n_gsm: fix wrong signal octet encoding in convergence layer type 2
x86/cpu: Load microcode during restore_processor_state()
drivers: net: hippi: Fix deadlock in rr_close()
cifs: destage any unwritten data to the server before calling copychunk_write
x86: __memcpy_flushcache: fix wrong alignment if size > 2^32
ASoC: wm8731: Disable the regulator when probing fails
bnx2x: fix napi API usage sequence
net: bcmgenet: hide status block before TX timestamping
clk: sunxi: sun9i-mmc: check return value after calling platform_get_resource()
bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create()
* tcp: fix potential xmit stalls caused by TCP_NOTSENT_LOWAT
include/net/tcp.h
net/ipv4/tcp_input.c
net/ipv4/tcp_output.c
ip_gre: Make o_seqno start from 0 in native mode
pinctrl: pistachio: fix use of irq_of_parse_and_map()
* sctp: check asoc strreset_chunk in sctp_generate_reconf_event
net/sctp/sm_sideeffect.c
mtd: rawnand: Fix return value check of wait_for_completion_timeout
ipvs: correctly print the memory size of ip_vs_conn_tab
ARM: dts: Fix mmc order for omap3-gta04
ARM: OMAP2+: Fix refcount leak in omap_gic_of_init
phy: samsung: exynos5250-sata: fix missing device put in probe error paths
phy: samsung: Fix missing of_node_put() in exynos_sata_phy_probe
ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue
* USB: Fix xhci event ring dequeue pointer ERDP update issue
drivers/usb/host/xhci-ring.c
* hex2bin: fix access beyond string end
lib/hexdump.c
* hex2bin: make the function hex_to_bin constant-time
include/linux/kernel.h
lib/hexdump.c
serial: 8250: Correct the clock for EndRun PTP/1588 PCIe device
serial: 8250: Also set sticky MCR bits in console restoration
* usb: gadget: configfs: clear deactivation flag in configfs_composite_unbind()
drivers/usb/gadget/configfs.c
usb: gadget: uvc: Fix crash when encoding data for usb request
usb: misc: fix improper handling of refcount in uss720_probe()
iio: magnetometer: ak8975: Fix the error handling in ak8975_power_on()
iio: dac: ad5446: Fix read_raw not returning set value
iio: dac: ad5592r: Fix the missing return value.
* xhci: stop polling roothubs after shutdown
drivers/usb/host/xhci.c
USB: serial: option: add Telit 0x1057, 0x1058, 0x1075 compositions
USB: serial: option: add support for Cinterion MV32-WA/MV32-WB
USB: serial: cp210x: add PIDs for Kamstrup USB Meter Reader
USB: serial: whiteheat: fix heap overflow in WHITEHEAT_GET_DTR_RTS
* USB: quirks: add STRING quirk for VCOM device
drivers/usb/core/quirks.c
* USB: quirks: add a Realtek card reader
drivers/usb/core/quirks.c
usb: mtu3: fix USB 3.0 dual-role-switch from device to host
* lightnvm: disable the subsystem
drivers/lightnvm/Kconfig
Revert "net: ethernet: stmmac: fix altr_tse_pcs function when using a fixed-link"
* net/sched: cls_u32: fix netns refcount changes in u32_change()
net/sched/cls_u32.c
hamradio: remove needs_free_netdev to avoid UAF
hamradio: defer 6pack kfree after unregister_netdev
* floppy: disable FDRAWCMD by default
drivers/block/Kconfig
Merge 4.14.277 into android-4.14-stable
Linux 4.14.277
* Revert "net: micrel: fix KS8851_MLL Kconfig"
drivers/net/ethernet/micrel/Kconfig
ax25: Fix UAF bugs in ax25 timers
ax25: Fix NULL pointer dereferences in ax25 timers
ax25: fix NPD bug in ax25_disconnect
ax25: fix UAF bug in ax25_send_control()
ax25: Fix refcount leaks caused by ax25_cb_del()
ax25: fix UAF bugs of net_device caused by rebinding operation
* ax25: fix reference count leaks of ax25_dev
include/net/ax25.h
* ax25: add refcount in ax25_dev to avoid UAF bugs
include/net/ax25.h
* block/compat_ioctl: fix range check in BLKGETSIZE
block/compat_ioctl.c
* staging: ion: Prevent incorrect reference counting behavour
drivers/staging/android/ion/ion.c
* ext4: force overhead calculation if the s_overhead_cluster makes no sense
fs/ext4/super.c
* ext4: fix overhead calculation to account for the reserved gdt blocks
fs/ext4/super.c
* ext4: limit length to bitmap_maxbytes - blocksize in punch_hole
fs/ext4/inode.c
* ext4: fix symlink file size not match to file content
fs/ext4/page-io.c
ARC: entry: fix syscall_trace_exit argument
e1000e: Fix possible overflow in LTR decoding
* ASoC: soc-dapm: fix two incorrect uses of list iterator
sound/soc/soc-dapm.c
openvswitch: fix OOB access in reserve_sfa_size()
powerpc/perf: Fix power9 event alternatives
dma: at_xdmac: fix a missing check on list iterator
ata: pata_marvell: Check the 'bmdma_addr' beforing reading
* stat: fix inconsistency between struct stat and struct compat_stat
fs/stat.c
net: macb: Restart tx only if queue pointer is lagging
drm/msm/mdp5: check the return of kzalloc()
brcmfmac: sdio: Fix undefined behavior due to shift overflowing the constant
cifs: Check the IOCB_DIRECT flag, not O_DIRECT
vxlan: fix error return code in vxlan_fdb_append
* ALSA: usb-audio: Fix undefined behavior due to shift overflowing the constant
sound/usb/usbaudio.h
platform/x86: samsung-laptop: Fix an unsigned comparison which can never be negative
ARM: vexpress/spc: Avoid negative array index when !SMP
* netlink: reset network and mac headers in netlink_dump()
net/netlink/af_netlink.c
* net/packet: fix packet_sock xmit return value checking
net/packet/af_packet.c
dmaengine: imx-sdma: Fix error checking in sdma_event_remap
* tcp: Fix potential use-after-free due to double kfree()
net/ipv4/tcp_ipv4.c
* tcp: fix race condition when creating child sockets from syncookies
include/net/inet_hashtables.h
net/ipv4/inet_connection_sock.c
net/ipv4/inet_hashtables.c
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c
* ALSA: usb-audio: Clear MIDI port active flag after draining
sound/usb/midi.c
gfs2: assign rgrp glock before compute_bitstructs
can: usb_8dev: usb_8dev_start_xmit(): fix double dev_kfree_skb() in error path
* tracing: Dump stacktrace trigger to the corresponding instance
kernel/trace/trace_events_trigger.c
* tracing: Have traceon and traceoff trigger honor the instance
kernel/trace/trace_events_trigger.c
* mm: page_alloc: fix building error on -Werror=array-compare
mm/page_alloc.c
* etherdevice: Adjust ether_addr* prototypes to silence -Wstringop-overead
include/linux/etherdevice.h
Bug: 233713524
Change-Id: I2ca590c399c782ac73106bb917ee7dc5dec38848
Signed-off-by: Lucas Wei <lucaswei@google.com>
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 276
|
||||
SUBLEVEL = 281
|
||||
EXTRAVERSION =
|
||||
NAME = Petit Gorille
|
||||
|
||||
|
||||
@@ -191,6 +191,7 @@ tracesys_exit:
|
||||
st r0, [sp, PT_r0] ; sys call return value in pt_regs
|
||||
|
||||
;POST Sys Call Ptrace Hook
|
||||
mov r0, sp ; pt_regs needed
|
||||
bl @syscall_trace_exit
|
||||
b ret_from_exception ; NOT ret_from_system_call at is saves r0 which
|
||||
; we'd done before calling post hook above
|
||||
|
||||
@@ -316,6 +316,8 @@
|
||||
codec: sgtl5000@0a {
|
||||
compatible = "fsl,sgtl5000";
|
||||
reg = <0x0a>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_sgtl5000>;
|
||||
clocks = <&clks IMX6QDL_CLK_CKO>;
|
||||
VDDA-supply = <®_2p5v>;
|
||||
VDDIO-supply = <®_3p3v>;
|
||||
@@ -543,8 +545,6 @@
|
||||
MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x130b0
|
||||
MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0
|
||||
MX6QDL_PAD_DISP0_DAT23__AUD4_RXD 0x130b0
|
||||
/* SGTL5000 sys_mclk */
|
||||
MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
|
||||
>;
|
||||
};
|
||||
|
||||
@@ -810,6 +810,12 @@
|
||||
>;
|
||||
};
|
||||
|
||||
pinctrl_sgtl5000: sgtl5000grp {
|
||||
fsl,pins = <
|
||||
MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
|
||||
>;
|
||||
};
|
||||
|
||||
pinctrl_spdif: spdifgrp {
|
||||
fsl,pins = <
|
||||
MX6QDL_PAD_GPIO_16__SPDIF_IN 0x1b0b0
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
aliases {
|
||||
display0 = &lcd;
|
||||
display1 = &tv0;
|
||||
/delete-property/ mmc2;
|
||||
/delete-property/ mmc3;
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
|
||||
@@ -1071,7 +1071,7 @@ vector_bhb_loop8_\name:
|
||||
|
||||
@ bhb workaround
|
||||
mov r0, #8
|
||||
3: b . + 4
|
||||
3: W(b) . + 4
|
||||
subs r0, r0, #1
|
||||
bne 3b
|
||||
dsb
|
||||
|
||||
@@ -51,17 +51,17 @@ int notrace unwind_frame(struct stackframe *frame)
|
||||
return -EINVAL;
|
||||
|
||||
frame->sp = frame->fp;
|
||||
frame->fp = *(unsigned long *)(fp);
|
||||
frame->pc = *(unsigned long *)(fp + 4);
|
||||
frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp));
|
||||
frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 4));
|
||||
#else
|
||||
/* check current frame pointer is within bounds */
|
||||
if (fp < low + 12 || fp > high - 4)
|
||||
return -EINVAL;
|
||||
|
||||
/* restore the registers from the stack frame */
|
||||
frame->fp = *(unsigned long *)(fp - 12);
|
||||
frame->sp = *(unsigned long *)(fp - 8);
|
||||
frame->pc = *(unsigned long *)(fp - 4);
|
||||
frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp - 12));
|
||||
frame->sp = READ_ONCE_NOCHECK(*(unsigned long *)(fp - 8));
|
||||
frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp - 4));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -342,10 +342,12 @@ void __init omap_gic_of_init(void)
|
||||
|
||||
np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic");
|
||||
gic_dist_base_addr = of_iomap(np, 0);
|
||||
of_node_put(np);
|
||||
WARN_ON(!gic_dist_base_addr);
|
||||
|
||||
np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-twd-timer");
|
||||
twd_base = of_iomap(np, 0);
|
||||
of_node_put(np);
|
||||
WARN_ON(!twd_base);
|
||||
|
||||
skip_errata_init:
|
||||
|
||||
@@ -584,7 +584,7 @@ static int __init ve_spc_clk_init(void)
|
||||
}
|
||||
|
||||
cluster = topology_physical_package_id(cpu_dev->id);
|
||||
if (init_opp_table[cluster])
|
||||
if (cluster < 0 || init_opp_table[cluster])
|
||||
continue;
|
||||
|
||||
if (ve_init_opp_table(cpu_dev))
|
||||
|
||||
@@ -297,6 +297,7 @@ void cpu_v7_ca15_ibe(void)
|
||||
{
|
||||
if (check_spectre_auxcr(this_cpu_ptr(&spectre_warned), BIT(0)))
|
||||
cpu_v7_spectre_v2_init();
|
||||
cpu_v7_spectre_bhb_init();
|
||||
}
|
||||
|
||||
void cpu_v7_bugs_init(void)
|
||||
|
||||
@@ -174,7 +174,7 @@ void __init plat_mem_setup(void)
|
||||
dtb = phys_to_virt(fw_arg2);
|
||||
else if (fw_passed_dtb) /* UHI interface */
|
||||
dtb = (void *)fw_passed_dtb;
|
||||
else if (__dtb_start != __dtb_end)
|
||||
else if (&__dtb_start != &__dtb_end)
|
||||
dtb = (void *)__dtb_start;
|
||||
else
|
||||
panic("no dtb found");
|
||||
|
||||
@@ -40,9 +40,9 @@
|
||||
typedef unsigned int cycles_t;
|
||||
|
||||
/*
|
||||
* On R4000/R4400 before version 5.0 an erratum exists such that if the
|
||||
* cycle counter is read in the exact moment that it is matching the
|
||||
* compare register, no interrupt will be generated.
|
||||
* On R4000/R4400 an erratum exists such that if the cycle counter is
|
||||
* read in the exact moment that it is matching the compare register,
|
||||
* no interrupt will be generated.
|
||||
*
|
||||
* There is a suggested workaround and also the erratum can't strike if
|
||||
* the compare interrupt isn't being used as the clock source device.
|
||||
@@ -63,7 +63,7 @@ static inline int can_use_mips_counter(unsigned int prid)
|
||||
if (!__builtin_constant_p(cpu_has_counter))
|
||||
asm volatile("" : "=m" (cpu_data[0].options));
|
||||
if (likely(cpu_has_counter &&
|
||||
prid >= (PRID_IMP_R4000 | PRID_REV_ENCODE_44(5, 0))))
|
||||
prid > (PRID_IMP_R4000 | PRID_REV_ENCODE_44(15, 15))))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
||||
@@ -155,15 +155,10 @@ static __init int cpu_has_mfc0_count_bug(void)
|
||||
case CPU_R4400MC:
|
||||
/*
|
||||
* The published errata for the R4400 up to 3.0 say the CPU
|
||||
* has the mfc0 from count bug.
|
||||
* has the mfc0 from count bug. This seems the last version
|
||||
* produced.
|
||||
*/
|
||||
if ((current_cpu_data.processor_id & 0xff) <= 0x30)
|
||||
return 1;
|
||||
|
||||
/*
|
||||
* we assume newer revisions are ok
|
||||
*/
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -169,6 +169,8 @@ static inline void clkdev_add_sys(const char *dev, unsigned int module,
|
||||
{
|
||||
struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||
|
||||
if (!clk)
|
||||
return;
|
||||
clk->cl.dev_id = dev;
|
||||
clk->cl.con_id = NULL;
|
||||
clk->cl.clk = clk;
|
||||
|
||||
@@ -82,7 +82,7 @@ void __init plat_mem_setup(void)
|
||||
|
||||
if (fw_passed_dtb) /* UHI interface */
|
||||
dtb = (void *)fw_passed_dtb;
|
||||
else if (__dtb_start != __dtb_end)
|
||||
else if (&__dtb_start != &__dtb_end)
|
||||
dtb = (void *)__dtb_start;
|
||||
else
|
||||
panic("no dtb found");
|
||||
|
||||
@@ -124,6 +124,8 @@ static inline void clkdev_add_gptu(struct device *dev, const char *con,
|
||||
{
|
||||
struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||
|
||||
if (!clk)
|
||||
return;
|
||||
clk->cl.dev_id = dev_name(dev);
|
||||
clk->cl.con_id = con;
|
||||
clk->cl.clk = clk;
|
||||
|
||||
@@ -313,6 +313,8 @@ static void clkdev_add_pmu(const char *dev, const char *con, bool deactivate,
|
||||
{
|
||||
struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||
|
||||
if (!clk)
|
||||
return;
|
||||
clk->cl.dev_id = dev;
|
||||
clk->cl.con_id = con;
|
||||
clk->cl.clk = clk;
|
||||
@@ -336,6 +338,8 @@ static void clkdev_add_cgu(const char *dev, const char *con,
|
||||
{
|
||||
struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||
|
||||
if (!clk)
|
||||
return;
|
||||
clk->cl.dev_id = dev;
|
||||
clk->cl.con_id = con;
|
||||
clk->cl.clk = clk;
|
||||
@@ -354,24 +358,28 @@ static void clkdev_add_pci(void)
|
||||
struct clk *clk_ext = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||
|
||||
/* main pci clock */
|
||||
clk->cl.dev_id = "17000000.pci";
|
||||
clk->cl.con_id = NULL;
|
||||
clk->cl.clk = clk;
|
||||
clk->rate = CLOCK_33M;
|
||||
clk->rates = valid_pci_rates;
|
||||
clk->enable = pci_enable;
|
||||
clk->disable = pmu_disable;
|
||||
clk->module = 0;
|
||||
clk->bits = PMU_PCI;
|
||||
clkdev_add(&clk->cl);
|
||||
if (clk) {
|
||||
clk->cl.dev_id = "17000000.pci";
|
||||
clk->cl.con_id = NULL;
|
||||
clk->cl.clk = clk;
|
||||
clk->rate = CLOCK_33M;
|
||||
clk->rates = valid_pci_rates;
|
||||
clk->enable = pci_enable;
|
||||
clk->disable = pmu_disable;
|
||||
clk->module = 0;
|
||||
clk->bits = PMU_PCI;
|
||||
clkdev_add(&clk->cl);
|
||||
}
|
||||
|
||||
/* use internal/external bus clock */
|
||||
clk_ext->cl.dev_id = "17000000.pci";
|
||||
clk_ext->cl.con_id = "external";
|
||||
clk_ext->cl.clk = clk_ext;
|
||||
clk_ext->enable = pci_ext_enable;
|
||||
clk_ext->disable = pci_ext_disable;
|
||||
clkdev_add(&clk_ext->cl);
|
||||
if (clk_ext) {
|
||||
clk_ext->cl.dev_id = "17000000.pci";
|
||||
clk_ext->cl.con_id = "external";
|
||||
clk_ext->cl.clk = clk_ext;
|
||||
clk_ext->enable = pci_ext_enable;
|
||||
clk_ext->disable = pci_ext_disable;
|
||||
clkdev_add(&clk_ext->cl);
|
||||
}
|
||||
}
|
||||
|
||||
/* xway socs can generate clocks on gpio pins */
|
||||
@@ -391,9 +399,15 @@ static void clkdev_add_clkout(void)
|
||||
char *name;
|
||||
|
||||
name = kzalloc(sizeof("clkout0"), GFP_KERNEL);
|
||||
if (!name)
|
||||
continue;
|
||||
sprintf(name, "clkout%d", i);
|
||||
|
||||
clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
|
||||
if (!clk) {
|
||||
kfree(name);
|
||||
continue;
|
||||
}
|
||||
clk->cl.dev_id = "1f103000.cgu";
|
||||
clk->cl.con_id = name;
|
||||
clk->cl.clk = clk;
|
||||
|
||||
@@ -36,7 +36,7 @@ static ulong get_fdtaddr(void)
|
||||
if (fw_passed_dtb && !fw_arg2 && !fw_arg3)
|
||||
return (ulong)fw_passed_dtb;
|
||||
|
||||
if (__dtb_start < __dtb_end)
|
||||
if (&__dtb_start < &__dtb_end)
|
||||
ftaddr = (ulong)__dtb_start;
|
||||
|
||||
return ftaddr;
|
||||
|
||||
@@ -79,7 +79,7 @@ void __init plat_mem_setup(void)
|
||||
*/
|
||||
if (fw_passed_dtb)
|
||||
dtb = (void *)fw_passed_dtb;
|
||||
else if (__dtb_start != __dtb_end)
|
||||
else if (&__dtb_start != &__dtb_end)
|
||||
dtb = (void *)__dtb_start;
|
||||
|
||||
__dt_setup_arch(dtb);
|
||||
|
||||
@@ -408,8 +408,7 @@ show_cpuinfo (struct seq_file *m, void *v)
|
||||
}
|
||||
seq_printf(m, " (0x%02lx)\n", boot_cpu_data.pdc.capabilities);
|
||||
|
||||
seq_printf(m, "model\t\t: %s\n"
|
||||
"model name\t: %s\n",
|
||||
seq_printf(m, "model\t\t: %s - %s\n",
|
||||
boot_cpu_data.pdc.sys_model_name,
|
||||
cpuinfo->dev ?
|
||||
cpuinfo->dev->name : "Unknown");
|
||||
|
||||
@@ -107,11 +107,11 @@ extern struct attribute_group isa207_pmu_format_group;
|
||||
|
||||
/* Table of alternatives, sorted by column 0 */
|
||||
static const unsigned int power9_event_alternatives[][MAX_ALT] = {
|
||||
{ PM_INST_DISP, PM_INST_DISP_ALT },
|
||||
{ PM_RUN_CYC_ALT, PM_RUN_CYC },
|
||||
{ PM_RUN_INST_CMPL_ALT, PM_RUN_INST_CMPL },
|
||||
{ PM_LD_MISS_L1, PM_LD_MISS_L1_ALT },
|
||||
{ PM_BR_2PATH, PM_BR_2PATH_ALT },
|
||||
{ PM_INST_DISP, PM_INST_DISP_ALT },
|
||||
{ PM_RUN_CYC_ALT, PM_RUN_CYC },
|
||||
{ PM_LD_MISS_L1, PM_LD_MISS_L1_ALT },
|
||||
{ PM_RUN_INST_CMPL_ALT, PM_RUN_INST_CMPL },
|
||||
};
|
||||
|
||||
static int power9_get_alternatives(u64 event, unsigned int flags, u64 alt[])
|
||||
|
||||
@@ -57,15 +57,13 @@ struct compat_timeval {
|
||||
};
|
||||
|
||||
struct compat_stat {
|
||||
compat_dev_t st_dev;
|
||||
u16 __pad1;
|
||||
u32 st_dev;
|
||||
compat_ino_t st_ino;
|
||||
compat_mode_t st_mode;
|
||||
compat_nlink_t st_nlink;
|
||||
__compat_uid_t st_uid;
|
||||
__compat_gid_t st_gid;
|
||||
compat_dev_t st_rdev;
|
||||
u16 __pad2;
|
||||
u32 st_rdev;
|
||||
u32 st_size;
|
||||
u32 st_blksize;
|
||||
u32 st_blocks;
|
||||
|
||||
@@ -147,11 +147,13 @@ extern void load_ucode_ap(void);
|
||||
void reload_early_microcode(void);
|
||||
extern bool get_builtin_firmware(struct cpio_data *cd, const char *name);
|
||||
extern bool initrd_gone;
|
||||
void microcode_bsp_resume(void);
|
||||
#else
|
||||
static inline int __init microcode_init(void) { return 0; };
|
||||
static inline void __init load_ucode_bsp(void) { }
|
||||
static inline void load_ucode_ap(void) { }
|
||||
static inline void reload_early_microcode(void) { }
|
||||
static inline void microcode_bsp_resume(void) { }
|
||||
static inline bool
|
||||
get_builtin_firmware(struct cpio_data *cd, const char *name) { return false; }
|
||||
#endif
|
||||
|
||||
@@ -773,9 +773,9 @@ static struct subsys_interface mc_cpu_interface = {
|
||||
};
|
||||
|
||||
/**
|
||||
* mc_bp_resume - Update boot CPU microcode during resume.
|
||||
* microcode_bsp_resume - Update boot CPU microcode during resume.
|
||||
*/
|
||||
static void mc_bp_resume(void)
|
||||
void microcode_bsp_resume(void)
|
||||
{
|
||||
int cpu = smp_processor_id();
|
||||
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
|
||||
@@ -787,7 +787,7 @@ static void mc_bp_resume(void)
|
||||
}
|
||||
|
||||
static struct syscore_ops mc_syscore_ops = {
|
||||
.resume = mc_bp_resume,
|
||||
.resume = microcode_bsp_resume,
|
||||
};
|
||||
|
||||
static int mc_cpu_starting(unsigned int cpu)
|
||||
|
||||
@@ -517,6 +517,11 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
|
||||
union cpuid10_eax eax;
|
||||
union cpuid10_edx edx;
|
||||
|
||||
if (!static_cpu_has(X86_FEATURE_ARCH_PERFMON)) {
|
||||
entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
perf_get_x86_pmu_capability(&cap);
|
||||
|
||||
/*
|
||||
|
||||
@@ -140,7 +140,7 @@ void memcpy_flushcache(void *_dst, const void *_src, size_t size)
|
||||
|
||||
/* cache copy and flush to align dest */
|
||||
if (!IS_ALIGNED(dest, 8)) {
|
||||
unsigned len = min_t(unsigned, size, ALIGN(dest, 8) - dest);
|
||||
size_t len = min_t(size_t, size, ALIGN(dest, 8) - dest);
|
||||
|
||||
memcpy((void *) dest, (void *) source, len);
|
||||
clean_cache_range((void *) dest, len);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <asm/cpu.h>
|
||||
#include <asm/mmu_context.h>
|
||||
#include <asm/cpu_device_id.h>
|
||||
#include <asm/microcode.h>
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
__visible unsigned long saved_context_ebx;
|
||||
@@ -268,6 +269,13 @@ static void notrace __restore_processor_state(struct saved_context *ctxt)
|
||||
x86_platform.restore_sched_clock_state();
|
||||
mtrr_bp_restore();
|
||||
perf_restore_debug_store();
|
||||
|
||||
microcode_bsp_resume();
|
||||
|
||||
/*
|
||||
* This needs to happen after the microcode has been updated upon resume
|
||||
* because some of the MSRs are "emulated" in microcode.
|
||||
*/
|
||||
msr_restore_context(ctxt);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,13 +10,12 @@
|
||||
#include <linux/msg.h>
|
||||
#include <linux/shm.h>
|
||||
|
||||
typedef long syscall_handler_t(void);
|
||||
typedef long syscall_handler_t(long, long, long, long, long, long);
|
||||
|
||||
extern syscall_handler_t *sys_call_table[];
|
||||
|
||||
#define EXECUTE_SYSCALL(syscall, regs) \
|
||||
(((long (*)(long, long, long, long, long, long)) \
|
||||
(*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(®s->regs), \
|
||||
(((*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(®s->regs), \
|
||||
UPT_SYSCALL_ARG2(®s->regs), \
|
||||
UPT_SYSCALL_ARG3(®s->regs), \
|
||||
UPT_SYSCALL_ARG4(®s->regs), \
|
||||
|
||||
@@ -391,7 +391,7 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
|
||||
return 0;
|
||||
case BLKGETSIZE:
|
||||
size = i_size_read(bdev->bd_inode);
|
||||
if ((size >> 9) > ~0UL)
|
||||
if ((size >> 9) > ~(compat_ulong_t)0)
|
||||
return -EFBIG;
|
||||
return compat_put_ulong(arg, size >> 9);
|
||||
|
||||
|
||||
@@ -82,6 +82,8 @@ static int marvell_cable_detect(struct ata_port *ap)
|
||||
switch(ap->port_no)
|
||||
{
|
||||
case 0:
|
||||
if (!ap->ioaddr.bmdma_addr)
|
||||
return ATA_CBL_PATA_UNK;
|
||||
if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1)
|
||||
return ATA_CBL_PATA40;
|
||||
return ATA_CBL_PATA80;
|
||||
|
||||
@@ -35,6 +35,22 @@ config BLK_DEV_FD
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called floppy.
|
||||
|
||||
config BLK_DEV_FD_RAWCMD
|
||||
bool "Support for raw floppy disk commands (DEPRECATED)"
|
||||
depends on BLK_DEV_FD
|
||||
help
|
||||
If you want to use actual physical floppies and expect to do
|
||||
special low-level hardware accesses to them (access and use
|
||||
non-standard formats, for example), then enable this.
|
||||
|
||||
Note that the code enabled by this option is rarely used and
|
||||
might be unstable or insecure, and distros should not enable it.
|
||||
|
||||
Note: FDRAWCMD is deprecated and will be removed from the kernel
|
||||
in the near future.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config AMIGA_FLOPPY
|
||||
tristate "Amiga floppy support"
|
||||
depends on AMIGA
|
||||
|
||||
@@ -195,7 +195,7 @@ void tl_release(struct drbd_connection *connection, unsigned int barrier_nr,
|
||||
unsigned int set_size)
|
||||
{
|
||||
struct drbd_request *r;
|
||||
struct drbd_request *req = NULL;
|
||||
struct drbd_request *req = NULL, *tmp = NULL;
|
||||
int expect_epoch = 0;
|
||||
int expect_size = 0;
|
||||
|
||||
@@ -249,8 +249,11 @@ void tl_release(struct drbd_connection *connection, unsigned int barrier_nr,
|
||||
* to catch requests being barrier-acked "unexpectedly".
|
||||
* It usually should find the same req again, or some READ preceding it. */
|
||||
list_for_each_entry(req, &connection->transfer_log, tl_requests)
|
||||
if (req->epoch == expect_epoch)
|
||||
if (req->epoch == expect_epoch) {
|
||||
tmp = req;
|
||||
break;
|
||||
}
|
||||
req = list_prepare_entry(tmp, &connection->transfer_log, tl_requests);
|
||||
list_for_each_entry_safe_from(req, r, &connection->transfer_log, tl_requests) {
|
||||
if (req->epoch != expect_epoch)
|
||||
break;
|
||||
|
||||
@@ -774,9 +774,11 @@ int drbd_adm_set_role(struct sk_buff *skb, struct genl_info *info)
|
||||
mutex_lock(&adm_ctx.resource->adm_mutex);
|
||||
|
||||
if (info->genlhdr->cmd == DRBD_ADM_PRIMARY)
|
||||
retcode = drbd_set_role(adm_ctx.device, R_PRIMARY, parms.assume_uptodate);
|
||||
retcode = (enum drbd_ret_code)drbd_set_role(adm_ctx.device,
|
||||
R_PRIMARY, parms.assume_uptodate);
|
||||
else
|
||||
retcode = drbd_set_role(adm_ctx.device, R_SECONDARY, 0);
|
||||
retcode = (enum drbd_ret_code)drbd_set_role(adm_ctx.device,
|
||||
R_SECONDARY, 0);
|
||||
|
||||
mutex_unlock(&adm_ctx.resource->adm_mutex);
|
||||
genl_lock();
|
||||
@@ -1941,7 +1943,7 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info)
|
||||
drbd_flush_workqueue(&connection->sender_work);
|
||||
|
||||
rv = _drbd_request_state(device, NS(disk, D_ATTACHING), CS_VERBOSE);
|
||||
retcode = rv; /* FIXME: Type mismatch. */
|
||||
retcode = (enum drbd_ret_code)rv;
|
||||
drbd_resume_io(device);
|
||||
if (rv < SS_SUCCESS)
|
||||
goto fail;
|
||||
@@ -2671,7 +2673,8 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info)
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
retcode = conn_request_state(connection, NS(conn, C_UNCONNECTED), CS_VERBOSE);
|
||||
retcode = (enum drbd_ret_code)conn_request_state(connection,
|
||||
NS(conn, C_UNCONNECTED), CS_VERBOSE);
|
||||
|
||||
conn_reconfig_done(connection);
|
||||
mutex_unlock(&adm_ctx.resource->adm_mutex);
|
||||
@@ -2777,7 +2780,7 @@ int drbd_adm_disconnect(struct sk_buff *skb, struct genl_info *info)
|
||||
mutex_lock(&adm_ctx.resource->adm_mutex);
|
||||
rv = conn_try_disconnect(connection, parms.force_disconnect);
|
||||
if (rv < SS_SUCCESS)
|
||||
retcode = rv; /* FIXME: Type mismatch. */
|
||||
retcode = (enum drbd_ret_code)rv;
|
||||
else
|
||||
retcode = NO_ERROR;
|
||||
mutex_unlock(&adm_ctx.resource->adm_mutex);
|
||||
|
||||
@@ -516,8 +516,8 @@ static unsigned long fdc_busy;
|
||||
static DECLARE_WAIT_QUEUE_HEAD(fdc_wait);
|
||||
static DECLARE_WAIT_QUEUE_HEAD(command_done);
|
||||
|
||||
/* Errors during formatting are counted here. */
|
||||
static int format_errors;
|
||||
/* errors encountered on the current (or last) request */
|
||||
static int floppy_errors;
|
||||
|
||||
/* Format request descriptor. */
|
||||
static struct format_descr format_req;
|
||||
@@ -537,7 +537,6 @@ static struct format_descr format_req;
|
||||
static char *floppy_track_buffer;
|
||||
static int max_buffer_sectors;
|
||||
|
||||
static int *errors;
|
||||
typedef void (*done_f)(int);
|
||||
static const struct cont_t {
|
||||
void (*interrupt)(void);
|
||||
@@ -1426,7 +1425,7 @@ static int interpret_errors(void)
|
||||
if (DP->flags & FTD_MSG)
|
||||
DPRINT("Over/Underrun - retrying\n");
|
||||
bad = 0;
|
||||
} else if (*errors >= DP->max_errors.reporting) {
|
||||
} else if (floppy_errors >= DP->max_errors.reporting) {
|
||||
print_errors();
|
||||
}
|
||||
if (ST2 & ST2_WC || ST2 & ST2_BC)
|
||||
@@ -2049,7 +2048,7 @@ static void bad_flp_intr(void)
|
||||
if (!next_valid_format())
|
||||
return;
|
||||
}
|
||||
err_count = ++(*errors);
|
||||
err_count = ++floppy_errors;
|
||||
INFBOUND(DRWE->badness, err_count);
|
||||
if (err_count > DP->max_errors.abort)
|
||||
cont->done(0);
|
||||
@@ -2194,9 +2193,8 @@ static int do_format(int drive, struct format_descr *tmp_format_req)
|
||||
return -EINVAL;
|
||||
}
|
||||
format_req = *tmp_format_req;
|
||||
format_errors = 0;
|
||||
cont = &format_cont;
|
||||
errors = &format_errors;
|
||||
floppy_errors = 0;
|
||||
ret = wait_til_done(redo_format, true);
|
||||
if (ret == -EINTR)
|
||||
return -EINTR;
|
||||
@@ -2679,7 +2677,7 @@ static int make_raw_rw_request(void)
|
||||
*/
|
||||
if (!direct ||
|
||||
(indirect * 2 > direct * 3 &&
|
||||
*errors < DP->max_errors.read_track &&
|
||||
floppy_errors < DP->max_errors.read_track &&
|
||||
((!probing ||
|
||||
(DP->read_track & (1 << DRS->probed_format)))))) {
|
||||
max_size = blk_rq_sectors(current_req);
|
||||
@@ -2813,7 +2811,7 @@ static int set_next_request(void)
|
||||
if (q) {
|
||||
current_req = blk_fetch_request(q);
|
||||
if (current_req) {
|
||||
current_req->error_count = 0;
|
||||
floppy_errors = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2875,7 +2873,6 @@ do_request:
|
||||
_floppy = floppy_type + DP->autodetect[DRS->probed_format];
|
||||
} else
|
||||
probing = 0;
|
||||
errors = &(current_req->error_count);
|
||||
tmp = make_raw_rw_request();
|
||||
if (tmp < 2) {
|
||||
request_done(tmp);
|
||||
@@ -3018,6 +3015,8 @@ static const char *drive_name(int type, int drive)
|
||||
return "(null)";
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_FD_RAWCMD
|
||||
|
||||
/* raw commands */
|
||||
static void raw_cmd_done(int flag)
|
||||
{
|
||||
@@ -3229,6 +3228,35 @@ static int raw_cmd_ioctl(int cmd, void __user *param)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int floppy_raw_cmd_ioctl(int type, int drive, int cmd,
|
||||
void __user *param)
|
||||
{
|
||||
int ret;
|
||||
|
||||
pr_warn_once("Note: FDRAWCMD is deprecated and will be removed from the kernel in the near future.\n");
|
||||
|
||||
if (type)
|
||||
return -EINVAL;
|
||||
if (lock_fdc(drive))
|
||||
return -EINTR;
|
||||
set_floppy(drive);
|
||||
ret = raw_cmd_ioctl(cmd, param);
|
||||
if (ret == -EINTR)
|
||||
return -EINTR;
|
||||
process_fd_request();
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else /* CONFIG_BLK_DEV_FD_RAWCMD */
|
||||
|
||||
static int floppy_raw_cmd_ioctl(int type, int drive, int cmd,
|
||||
void __user *param)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static int invalidate_drive(struct block_device *bdev)
|
||||
{
|
||||
/* invalidate the buffer track to force a reread */
|
||||
@@ -3416,7 +3444,6 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
|
||||
{
|
||||
int drive = (long)bdev->bd_disk->private_data;
|
||||
int type = ITYPE(UDRS->fd_device);
|
||||
int i;
|
||||
int ret;
|
||||
int size;
|
||||
union inparam {
|
||||
@@ -3567,16 +3594,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
|
||||
outparam = UDRWE;
|
||||
break;
|
||||
case FDRAWCMD:
|
||||
if (type)
|
||||
return -EINVAL;
|
||||
if (lock_fdc(drive))
|
||||
return -EINTR;
|
||||
set_floppy(drive);
|
||||
i = raw_cmd_ioctl(cmd, (void __user *)param);
|
||||
if (i == -EINTR)
|
||||
return -EINTR;
|
||||
process_fd_request();
|
||||
return i;
|
||||
return floppy_raw_cmd_ioctl(type, drive, cmd, (void __user *)param);
|
||||
case FDTWADDLE:
|
||||
if (lock_fdc(drive))
|
||||
return -EINTR;
|
||||
|
||||
@@ -224,6 +224,8 @@ static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb,
|
||||
|
||||
dev_dbg(&rdev->dev, "device %s registered\n", dev_name(&rdev->dev));
|
||||
|
||||
return rdev;
|
||||
|
||||
err_device_add:
|
||||
put_device(&rdev->dev);
|
||||
|
||||
|
||||
@@ -119,6 +119,10 @@ static void clk_generated_best_diff(struct clk_rate_request *req,
|
||||
tmp_rate = parent_rate;
|
||||
else
|
||||
tmp_rate = parent_rate / div;
|
||||
|
||||
if (tmp_rate < req->min_rate || tmp_rate > req->max_rate)
|
||||
return;
|
||||
|
||||
tmp_diff = abs(req->rate - tmp_rate);
|
||||
|
||||
if (*best_diff < 0 || *best_diff > tmp_diff) {
|
||||
|
||||
@@ -117,6 +117,8 @@ static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev)
|
||||
spin_lock_init(&data->lock);
|
||||
|
||||
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!r)
|
||||
return -EINVAL;
|
||||
/* one clock/reset pair per word */
|
||||
count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH);
|
||||
data->membase = devm_ioremap_resource(&pdev->dev, r);
|
||||
|
||||
@@ -1390,7 +1390,7 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
|
||||
{
|
||||
struct at_xdmac_chan *atchan = to_at_xdmac_chan(chan);
|
||||
struct at_xdmac *atxdmac = to_at_xdmac(atchan->chan.device);
|
||||
struct at_xdmac_desc *desc, *_desc;
|
||||
struct at_xdmac_desc *desc, *_desc, *iter;
|
||||
struct list_head *descs_list;
|
||||
enum dma_status ret;
|
||||
int residue, retry;
|
||||
@@ -1505,11 +1505,13 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
|
||||
* microblock.
|
||||
*/
|
||||
descs_list = &desc->descs_list;
|
||||
list_for_each_entry_safe(desc, _desc, descs_list, desc_node) {
|
||||
dwidth = at_xdmac_get_dwidth(desc->lld.mbr_cfg);
|
||||
residue -= (desc->lld.mbr_ubc & 0xffffff) << dwidth;
|
||||
if ((desc->lld.mbr_nda & 0xfffffffc) == cur_nda)
|
||||
list_for_each_entry_safe(iter, _desc, descs_list, desc_node) {
|
||||
dwidth = at_xdmac_get_dwidth(iter->lld.mbr_cfg);
|
||||
residue -= (iter->lld.mbr_ubc & 0xffffff) << dwidth;
|
||||
if ((iter->lld.mbr_nda & 0xfffffffc) == cur_nda) {
|
||||
desc = iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
residue += cur_ubc << dwidth;
|
||||
|
||||
|
||||
@@ -1528,7 +1528,7 @@ static int sdma_event_remap(struct sdma_engine *sdma)
|
||||
u32 reg, val, shift, num_map, i;
|
||||
int ret = 0;
|
||||
|
||||
if (IS_ERR(np) || IS_ERR(gpr_np))
|
||||
if (IS_ERR(np) || !gpr_np)
|
||||
goto out;
|
||||
|
||||
event_remap = of_find_property(np, propname, NULL);
|
||||
@@ -1576,7 +1576,7 @@ static int sdma_event_remap(struct sdma_engine *sdma)
|
||||
}
|
||||
|
||||
out:
|
||||
if (!IS_ERR(gpr_np))
|
||||
if (gpr_np)
|
||||
of_node_put(gpr_np);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -681,6 +681,7 @@ EXPORT_SYMBOL_GPL(fw_card_release);
|
||||
void fw_core_remove_card(struct fw_card *card)
|
||||
{
|
||||
struct fw_card_driver dummy_driver = dummy_driver_template;
|
||||
unsigned long flags;
|
||||
|
||||
card->driver->update_phy_reg(card, 4,
|
||||
PHY_LINK_ACTIVE | PHY_CONTENDER, 0);
|
||||
@@ -695,7 +696,9 @@ void fw_core_remove_card(struct fw_card *card)
|
||||
dummy_driver.stop_iso = card->driver->stop_iso;
|
||||
card->driver = &dummy_driver;
|
||||
|
||||
spin_lock_irqsave(&card->lock, flags);
|
||||
fw_destroy_nodes(card);
|
||||
spin_unlock_irqrestore(&card->lock, flags);
|
||||
|
||||
/* Wait for all users, especially device workqueue jobs, to finish. */
|
||||
fw_card_put(card);
|
||||
|
||||
@@ -1495,6 +1495,7 @@ static void outbound_phy_packet_callback(struct fw_packet *packet,
|
||||
{
|
||||
struct outbound_phy_packet_event *e =
|
||||
container_of(packet, struct outbound_phy_packet_event, p);
|
||||
struct client *e_client;
|
||||
|
||||
switch (status) {
|
||||
/* expected: */
|
||||
@@ -1511,9 +1512,10 @@ static void outbound_phy_packet_callback(struct fw_packet *packet,
|
||||
}
|
||||
e->phy_packet.data[0] = packet->timestamp;
|
||||
|
||||
e_client = e->client;
|
||||
queue_event(e->client, &e->event, &e->phy_packet,
|
||||
sizeof(e->phy_packet) + e->phy_packet.length, NULL, 0);
|
||||
client_put(e->client);
|
||||
client_put(e_client);
|
||||
}
|
||||
|
||||
static int ioctl_send_phy_packet(struct client *client, union ioctl_arg *arg)
|
||||
|
||||
@@ -387,16 +387,13 @@ static void report_found_node(struct fw_card *card,
|
||||
card->bm_retries = 0;
|
||||
}
|
||||
|
||||
/* Must be called with card->lock held */
|
||||
void fw_destroy_nodes(struct fw_card *card)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&card->lock, flags);
|
||||
card->color++;
|
||||
if (card->local_node != NULL)
|
||||
for_each_fw_node(card, card->local_node, report_lost_node);
|
||||
card->local_node = NULL;
|
||||
spin_unlock_irqrestore(&card->lock, flags);
|
||||
}
|
||||
|
||||
static void move_tree(struct fw_node *node0, struct fw_node *node1, int port)
|
||||
@@ -522,6 +519,8 @@ void fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation,
|
||||
struct fw_node *local_node;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&card->lock, flags);
|
||||
|
||||
/*
|
||||
* If the selfID buffer is not the immediate successor of the
|
||||
* previously processed one, we cannot reliably compare the
|
||||
@@ -533,8 +532,6 @@ void fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation,
|
||||
card->bm_retries = 0;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&card->lock, flags);
|
||||
|
||||
card->broadcast_channel_allocated = card->broadcast_channel_auto_allocated;
|
||||
card->node_id = node_id;
|
||||
/*
|
||||
|
||||
@@ -86,24 +86,25 @@ static int try_cancel_split_timeout(struct fw_transaction *t)
|
||||
static int close_transaction(struct fw_transaction *transaction,
|
||||
struct fw_card *card, int rcode)
|
||||
{
|
||||
struct fw_transaction *t;
|
||||
struct fw_transaction *t = NULL, *iter;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&card->lock, flags);
|
||||
list_for_each_entry(t, &card->transaction_list, link) {
|
||||
if (t == transaction) {
|
||||
if (!try_cancel_split_timeout(t)) {
|
||||
list_for_each_entry(iter, &card->transaction_list, link) {
|
||||
if (iter == transaction) {
|
||||
if (!try_cancel_split_timeout(iter)) {
|
||||
spin_unlock_irqrestore(&card->lock, flags);
|
||||
goto timed_out;
|
||||
}
|
||||
list_del_init(&t->link);
|
||||
card->tlabel_mask &= ~(1ULL << t->tlabel);
|
||||
list_del_init(&iter->link);
|
||||
card->tlabel_mask &= ~(1ULL << iter->tlabel);
|
||||
t = iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&card->lock, flags);
|
||||
|
||||
if (&t->link != &card->transaction_list) {
|
||||
if (t) {
|
||||
t->callback(card, rcode, NULL, 0, t->callback_data);
|
||||
return 0;
|
||||
}
|
||||
@@ -938,7 +939,7 @@ EXPORT_SYMBOL(fw_core_handle_request);
|
||||
|
||||
void fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
|
||||
{
|
||||
struct fw_transaction *t;
|
||||
struct fw_transaction *t = NULL, *iter;
|
||||
unsigned long flags;
|
||||
u32 *data;
|
||||
size_t data_length;
|
||||
@@ -950,20 +951,21 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
|
||||
rcode = HEADER_GET_RCODE(p->header[1]);
|
||||
|
||||
spin_lock_irqsave(&card->lock, flags);
|
||||
list_for_each_entry(t, &card->transaction_list, link) {
|
||||
if (t->node_id == source && t->tlabel == tlabel) {
|
||||
if (!try_cancel_split_timeout(t)) {
|
||||
list_for_each_entry(iter, &card->transaction_list, link) {
|
||||
if (iter->node_id == source && iter->tlabel == tlabel) {
|
||||
if (!try_cancel_split_timeout(iter)) {
|
||||
spin_unlock_irqrestore(&card->lock, flags);
|
||||
goto timed_out;
|
||||
}
|
||||
list_del_init(&t->link);
|
||||
card->tlabel_mask &= ~(1ULL << t->tlabel);
|
||||
list_del_init(&iter->link);
|
||||
card->tlabel_mask &= ~(1ULL << iter->tlabel);
|
||||
t = iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&card->lock, flags);
|
||||
|
||||
if (&t->link == &card->transaction_list) {
|
||||
if (!t) {
|
||||
timed_out:
|
||||
fw_notice(card, "unsolicited response (source %x, tlabel %x)\n",
|
||||
source, tlabel);
|
||||
|
||||
@@ -421,7 +421,7 @@ static void sbp2_status_write(struct fw_card *card, struct fw_request *request,
|
||||
void *payload, size_t length, void *callback_data)
|
||||
{
|
||||
struct sbp2_logical_unit *lu = callback_data;
|
||||
struct sbp2_orb *orb;
|
||||
struct sbp2_orb *orb = NULL, *iter;
|
||||
struct sbp2_status status;
|
||||
unsigned long flags;
|
||||
|
||||
@@ -446,17 +446,18 @@ static void sbp2_status_write(struct fw_card *card, struct fw_request *request,
|
||||
|
||||
/* Lookup the orb corresponding to this status write. */
|
||||
spin_lock_irqsave(&lu->tgt->lock, flags);
|
||||
list_for_each_entry(orb, &lu->orb_list, link) {
|
||||
list_for_each_entry(iter, &lu->orb_list, link) {
|
||||
if (STATUS_GET_ORB_HIGH(status) == 0 &&
|
||||
STATUS_GET_ORB_LOW(status) == orb->request_bus) {
|
||||
orb->rcode = RCODE_COMPLETE;
|
||||
list_del(&orb->link);
|
||||
STATUS_GET_ORB_LOW(status) == iter->request_bus) {
|
||||
iter->rcode = RCODE_COMPLETE;
|
||||
list_del(&iter->link);
|
||||
orb = iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&lu->tgt->lock, flags);
|
||||
|
||||
if (&orb->link != &lu->orb_list) {
|
||||
if (orb) {
|
||||
orb->callback(orb, &status);
|
||||
kref_put(&orb->kref, free_orb); /* orb callback reference */
|
||||
} else {
|
||||
|
||||
@@ -694,6 +694,9 @@ static int mvebu_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
|
||||
unsigned long flags;
|
||||
unsigned int on, off;
|
||||
|
||||
if (state->polarity != PWM_POLARITY_NORMAL)
|
||||
return -EINVAL;
|
||||
|
||||
val = (unsigned long long) mvpwm->clk_rate * state->duty_cycle;
|
||||
do_div(val, NSEC_PER_SEC);
|
||||
if (val > UINT_MAX)
|
||||
|
||||
@@ -135,9 +135,13 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
|
||||
{
|
||||
struct vf610_gpio_port *port = gpiochip_get_data(chip);
|
||||
unsigned long mask = BIT(gpio);
|
||||
u32 val;
|
||||
|
||||
if (port->sdata && port->sdata->have_paddr)
|
||||
vf610_gpio_writel(mask, port->gpio_base + GPIO_PDDR);
|
||||
if (port->sdata && port->sdata->have_paddr) {
|
||||
val = vf610_gpio_readl(port->gpio_base + GPIO_PDDR);
|
||||
val |= mask;
|
||||
vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR);
|
||||
}
|
||||
|
||||
vf610_gpio_set(chip, gpio, value);
|
||||
|
||||
|
||||
@@ -3043,6 +3043,7 @@ static void fetch_monitor_name(struct drm_dp_mst_topology_mgr *mgr,
|
||||
|
||||
mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port);
|
||||
drm_edid_get_monitor_name(mst_edid, name, namelen);
|
||||
kfree(mst_edid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -197,7 +197,10 @@ static void mdp5_plane_reset(struct drm_plane *plane)
|
||||
drm_framebuffer_unreference(plane->state->fb);
|
||||
|
||||
kfree(to_mdp5_plane_state(plane->state));
|
||||
plane->state = NULL;
|
||||
mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL);
|
||||
if (!mdp5_state)
|
||||
return;
|
||||
|
||||
/* assign default blend parameters */
|
||||
mdp5_state->alpha = 255;
|
||||
|
||||
@@ -190,9 +190,10 @@ static struct drm_gem_object *vgem_gem_create(struct drm_device *dev,
|
||||
return ERR_CAST(obj);
|
||||
|
||||
ret = drm_gem_handle_create(file, &obj->base, handle);
|
||||
drm_gem_object_put_unlocked(&obj->base);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
drm_gem_object_put_unlocked(&obj->base);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
return &obj->base;
|
||||
}
|
||||
@@ -215,7 +216,9 @@ static int vgem_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
|
||||
args->size = gem_object->size;
|
||||
args->pitch = pitch;
|
||||
|
||||
DRM_DEBUG_DRIVER("Created object of size %lld\n", size);
|
||||
drm_gem_object_put_unlocked(gem_object);
|
||||
|
||||
DRM_DEBUG_DRIVER("Created object of size %llu\n", args->size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ static int vmw_fb_kms_detach(struct vmw_fb_par *par,
|
||||
|
||||
static int vmw_fb_kms_framebuffer(struct fb_info *info)
|
||||
{
|
||||
struct drm_mode_fb_cmd2 mode_cmd;
|
||||
struct drm_mode_fb_cmd2 mode_cmd = {0};
|
||||
struct vmw_fb_par *par = info->par;
|
||||
struct fb_var_screeninfo *var = &info->var;
|
||||
struct drm_framebuffer *cur_fb;
|
||||
|
||||
@@ -793,7 +793,7 @@ config SENSORS_LTC4261
|
||||
|
||||
config SENSORS_LTQ_CPUTEMP
|
||||
bool "Lantiq cpu temperature sensor driver"
|
||||
depends on LANTIQ
|
||||
depends on SOC_XWAY
|
||||
help
|
||||
If you say yes here you get support for the temperature
|
||||
sensor inside your CPU.
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/util_macros.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
/* Addresses to scan */
|
||||
static const unsigned short normal_i2c[] = { 0x2C, 0x2E, 0x2F, I2C_CLIENT_END };
|
||||
@@ -273,11 +274,10 @@ static int adt7470_update_thread(void *p)
|
||||
adt7470_read_temperatures(client, data);
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
if (kthread_should_stop())
|
||||
break;
|
||||
|
||||
schedule_timeout(msecs_to_jiffies(data->auto_update_interval));
|
||||
schedule_timeout_interruptible(msecs_to_jiffies(data->auto_update_interval));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1590,8 +1590,9 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
|
||||
temp *= 125;
|
||||
if (sign)
|
||||
temp -= 128000;
|
||||
} else
|
||||
temp = data->temp[nr] * 1000;
|
||||
} else {
|
||||
temp = ((s8)data->temp[nr]) * 1000;
|
||||
}
|
||||
|
||||
return sprintf(buf, "%d\n", temp);
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ static int ad5446_read_raw(struct iio_dev *indio_dev,
|
||||
|
||||
switch (m) {
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
*val = st->cached_val;
|
||||
*val = st->cached_val >> chan->scan_type.shift;
|
||||
return IIO_VAL_INT;
|
||||
case IIO_CHAN_INFO_SCALE:
|
||||
*val = st->vref_mv;
|
||||
|
||||
@@ -532,7 +532,7 @@ static int ad5592r_alloc_channels(struct ad5592r_state *st)
|
||||
if (!ret)
|
||||
st->channel_modes[reg] = tmp;
|
||||
|
||||
fwnode_property_read_u32(child, "adi,off-state", &tmp);
|
||||
ret = fwnode_property_read_u32(child, "adi,off-state", &tmp);
|
||||
if (!ret)
|
||||
st->channel_offstate[reg] = tmp;
|
||||
}
|
||||
|
||||
@@ -404,6 +404,7 @@ static int ak8975_power_on(const struct ak8975_data *data)
|
||||
if (ret) {
|
||||
dev_warn(&data->client->dev,
|
||||
"Failed to enable specified Vid supply\n");
|
||||
regulator_disable(data->vdd);
|
||||
return ret;
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -50,6 +50,17 @@ static DEFINE_MUTEX(input_mutex);
|
||||
|
||||
static const struct input_value input_value_sync = { EV_SYN, SYN_REPORT, 1 };
|
||||
|
||||
static const unsigned int input_max_code[EV_CNT] = {
|
||||
[EV_KEY] = KEY_MAX,
|
||||
[EV_REL] = REL_MAX,
|
||||
[EV_ABS] = ABS_MAX,
|
||||
[EV_MSC] = MSC_MAX,
|
||||
[EV_SW] = SW_MAX,
|
||||
[EV_LED] = LED_MAX,
|
||||
[EV_SND] = SND_MAX,
|
||||
[EV_FF] = FF_MAX,
|
||||
};
|
||||
|
||||
static inline int is_event_supported(unsigned int code,
|
||||
unsigned long *bm, unsigned int max)
|
||||
{
|
||||
@@ -1963,6 +1974,14 @@ EXPORT_SYMBOL(input_get_timestamp);
|
||||
*/
|
||||
void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code)
|
||||
{
|
||||
if (type < EV_CNT && input_max_code[type] &&
|
||||
code > input_max_code[type]) {
|
||||
pr_err("%s: invalid code %u for type %u\n", __func__, code,
|
||||
type);
|
||||
dump_stack();
|
||||
return;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case EV_KEY:
|
||||
__set_bit(code, dev->keybit);
|
||||
|
||||
@@ -344,11 +344,11 @@ static int stmfts_input_open(struct input_dev *dev)
|
||||
|
||||
err = pm_runtime_get_sync(&sdata->client->dev);
|
||||
if (err < 0)
|
||||
return err;
|
||||
goto out;
|
||||
|
||||
err = i2c_smbus_write_byte(sdata->client, STMFTS_MS_MT_SENSE_ON);
|
||||
if (err)
|
||||
return err;
|
||||
goto out;
|
||||
|
||||
mutex_lock(&sdata->mutex);
|
||||
sdata->running = true;
|
||||
@@ -371,7 +371,9 @@ static int stmfts_input_open(struct input_dev *dev)
|
||||
"failed to enable touchkey\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
out:
|
||||
pm_runtime_put_noidle(&sdata->client->dev);
|
||||
return err;
|
||||
}
|
||||
|
||||
static void stmfts_input_close(struct input_dev *dev)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
menuconfig NVM
|
||||
bool "Open-Channel SSD target support"
|
||||
depends on BLOCK && HAS_DMA
|
||||
depends on BLOCK && HAS_DMA && BROKEN
|
||||
help
|
||||
Say Y here to get to enable Open-channel SSDs.
|
||||
|
||||
|
||||
@@ -528,20 +528,19 @@ static void start_io_acct(struct dm_io *io)
|
||||
false, 0, &io->stats_aux);
|
||||
}
|
||||
|
||||
static void end_io_acct(struct dm_io *io)
|
||||
static void end_io_acct(struct mapped_device *md, struct bio *bio,
|
||||
unsigned long start_time, struct dm_stats_aux *stats_aux)
|
||||
{
|
||||
struct mapped_device *md = io->md;
|
||||
struct bio *bio = io->bio;
|
||||
unsigned long duration = jiffies - io->start_time;
|
||||
unsigned long duration = jiffies - start_time;
|
||||
int pending;
|
||||
int rw = bio_data_dir(bio);
|
||||
|
||||
generic_end_io_acct(md->queue, rw, &dm_disk(md)->part0, io->start_time);
|
||||
generic_end_io_acct(md->queue, rw, &dm_disk(md)->part0, start_time);
|
||||
|
||||
if (unlikely(dm_stats_used(&md->stats)))
|
||||
dm_stats_account_io(&md->stats, bio_data_dir(bio),
|
||||
bio->bi_iter.bi_sector, bio_sectors(bio),
|
||||
true, duration, &io->stats_aux);
|
||||
true, duration, stats_aux);
|
||||
|
||||
/*
|
||||
* After this is decremented the bio must not be touched if it is
|
||||
@@ -775,6 +774,8 @@ static void dec_pending(struct dm_io *io, blk_status_t error)
|
||||
blk_status_t io_error;
|
||||
struct bio *bio;
|
||||
struct mapped_device *md = io->md;
|
||||
unsigned long start_time = 0;
|
||||
struct dm_stats_aux stats_aux;
|
||||
|
||||
/* Push-back supersedes any I/O errors */
|
||||
if (unlikely(error)) {
|
||||
@@ -801,8 +802,10 @@ static void dec_pending(struct dm_io *io, blk_status_t error)
|
||||
|
||||
io_error = io->status;
|
||||
bio = io->bio;
|
||||
end_io_acct(io);
|
||||
start_time = io->start_time;
|
||||
stats_aux = io->stats_aux;
|
||||
free_io(md, io);
|
||||
end_io_acct(md, bio, start_time, &stats_aux);
|
||||
|
||||
if (io_error == BLK_STS_DM_REQUEUE)
|
||||
return;
|
||||
@@ -2227,6 +2230,8 @@ static int dm_wait_for_completion(struct mapped_device *md, long task_state)
|
||||
}
|
||||
finish_wait(&md->wait, &wait);
|
||||
|
||||
smp_rmb(); /* paired with atomic_dec_return in end_io_acct */
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
@@ -1813,7 +1813,7 @@ static void mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
|
||||
arg == MMC_TRIM_ARG ?
|
||||
INAND_CMD38_ARG_TRIM :
|
||||
INAND_CMD38_ARG_ERASE,
|
||||
0);
|
||||
card->ext_csd.generic_cmd6_time);
|
||||
}
|
||||
if (!err)
|
||||
err = mmc_erase(card, from, nr, arg);
|
||||
@@ -1855,7 +1855,7 @@ retry:
|
||||
arg == MMC_SECURE_TRIM1_ARG ?
|
||||
INAND_CMD38_ARG_SECTRIM1 :
|
||||
INAND_CMD38_ARG_SECERASE,
|
||||
0);
|
||||
card->ext_csd.generic_cmd6_time);
|
||||
if (err)
|
||||
goto out_retry;
|
||||
}
|
||||
@@ -1873,7 +1873,7 @@ retry:
|
||||
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
|
||||
INAND_CMD38_ARG_EXT_CSD,
|
||||
INAND_CMD38_ARG_SECTRIM2,
|
||||
0);
|
||||
card->ext_csd.generic_cmd6_time);
|
||||
if (err)
|
||||
goto out_retry;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
#include "host.h"
|
||||
#include "mmc_ops.h"
|
||||
|
||||
#define MMC_OPS_TIMEOUT_MS (10 * 60 * 1000) /* 10 minute timeout */
|
||||
#define MMC_OPS_TIMEOUT_MS (10 * 60 * 1000) /* 10min*/
|
||||
#define MMC_BKOPS_TIMEOUT_MS (120 * 1000) /* 120s */
|
||||
#define MMC_CACHE_FLUSH_TIMEOUT_MS (30 * 1000) /* 30s */
|
||||
|
||||
static const u8 tuning_blk_pattern_4bit[] = {
|
||||
0xff, 0x0f, 0xff, 0x00, 0xff, 0xcc, 0xc3, 0xcc,
|
||||
@@ -465,10 +467,6 @@ static int mmc_poll_for_busy(struct mmc_card *card, unsigned int timeout_ms,
|
||||
bool busy = false;
|
||||
int retries = 5;
|
||||
|
||||
/* We have an unspecified cmd timeout, use the fallback value. */
|
||||
if (!timeout_ms)
|
||||
timeout_ms = MMC_OPS_TIMEOUT_MS;
|
||||
|
||||
/*
|
||||
* In cases when not allowed to poll by using CMD13 or because we aren't
|
||||
* capable of polling by using ->card_busy(), then rely on waiting the
|
||||
@@ -587,14 +585,20 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
|
||||
|
||||
mmc_retune_hold(host);
|
||||
|
||||
if (!timeout_ms) {
|
||||
pr_warn("%s: unspecified timeout for CMD6 - use generic\n",
|
||||
mmc_hostname(host));
|
||||
timeout_ms = card->ext_csd.generic_cmd6_time;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the cmd timeout and the max_busy_timeout of the host are both
|
||||
* specified, let's validate them. A failure means we need to prevent
|
||||
* the host from doing hw busy detection, which is done by converting
|
||||
* to a R1 response instead of a R1B.
|
||||
*/
|
||||
if (timeout_ms && host->max_busy_timeout &&
|
||||
(timeout_ms > host->max_busy_timeout))
|
||||
if (host->max_busy_timeout &&
|
||||
(timeout_ms > host->max_busy_timeout))
|
||||
use_r1b_resp = false;
|
||||
|
||||
mmc_prepare_switch(&cmd, index, value, set, timeout_ms,
|
||||
@@ -1061,7 +1065,7 @@ void mmc_start_bkops(struct mmc_card *card, bool from_exception)
|
||||
|
||||
mmc_claim_host(card->host);
|
||||
if (card->ext_csd.raw_bkops_status >= EXT_CSD_BKOPS_LEVEL_2) {
|
||||
timeout = MMC_OPS_TIMEOUT_MS;
|
||||
timeout = MMC_BKOPS_TIMEOUT_MS;
|
||||
use_busy_signal = true;
|
||||
} else {
|
||||
timeout = 0;
|
||||
@@ -1105,7 +1109,8 @@ int mmc_flush_cache(struct mmc_card *card)
|
||||
(card->ext_csd.cache_ctrl & 1) &&
|
||||
(!(card->quirks & MMC_QUIRK_CACHE_DISABLE))) {
|
||||
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
|
||||
EXT_CSD_FLUSH_CACHE, 1, 0);
|
||||
EXT_CSD_FLUSH_CACHE, 1,
|
||||
MMC_CACHE_FLUSH_TIMEOUT_MS);
|
||||
if (err == -ETIMEDOUT) {
|
||||
pr_err("%s: cache flush timeout\n",
|
||||
mmc_hostname(card->host));
|
||||
|
||||
@@ -49,10 +49,7 @@ struct realtek_pci_sdmmc {
|
||||
bool double_clk;
|
||||
bool eject;
|
||||
bool initial_mode;
|
||||
int power_state;
|
||||
#define SDMMC_POWER_ON 1
|
||||
#define SDMMC_POWER_OFF 0
|
||||
|
||||
int prev_power_state;
|
||||
int sg_count;
|
||||
s32 cookie;
|
||||
int cookie_sg_count;
|
||||
@@ -913,14 +910,21 @@ static int sd_set_bus_width(struct realtek_pci_sdmmc *host,
|
||||
return err;
|
||||
}
|
||||
|
||||
static int sd_power_on(struct realtek_pci_sdmmc *host)
|
||||
static int sd_power_on(struct realtek_pci_sdmmc *host, unsigned char power_mode)
|
||||
{
|
||||
struct rtsx_pcr *pcr = host->pcr;
|
||||
int err;
|
||||
|
||||
if (host->power_state == SDMMC_POWER_ON)
|
||||
if (host->prev_power_state == MMC_POWER_ON)
|
||||
return 0;
|
||||
|
||||
if (host->prev_power_state == MMC_POWER_UP) {
|
||||
rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, 0);
|
||||
goto finish;
|
||||
}
|
||||
|
||||
msleep(100);
|
||||
|
||||
rtsx_pci_init_cmd(pcr);
|
||||
rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SELECT, 0x07, SD_MOD_SEL);
|
||||
rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SHARE_MODE,
|
||||
@@ -939,11 +943,17 @@ static int sd_power_on(struct realtek_pci_sdmmc *host)
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
mdelay(1);
|
||||
|
||||
err = rtsx_pci_write_register(pcr, CARD_OE, SD_OUTPUT_EN, SD_OUTPUT_EN);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
host->power_state = SDMMC_POWER_ON;
|
||||
/* send at least 74 clocks */
|
||||
rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, SD_CLK_TOGGLE_EN);
|
||||
|
||||
finish:
|
||||
host->prev_power_state = power_mode;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -952,7 +962,7 @@ static int sd_power_off(struct realtek_pci_sdmmc *host)
|
||||
struct rtsx_pcr *pcr = host->pcr;
|
||||
int err;
|
||||
|
||||
host->power_state = SDMMC_POWER_OFF;
|
||||
host->prev_power_state = MMC_POWER_OFF;
|
||||
|
||||
rtsx_pci_init_cmd(pcr);
|
||||
|
||||
@@ -978,7 +988,7 @@ static int sd_set_power_mode(struct realtek_pci_sdmmc *host,
|
||||
if (power_mode == MMC_POWER_OFF)
|
||||
err = sd_power_off(host);
|
||||
else
|
||||
err = sd_power_on(host);
|
||||
err = sd_power_on(host, power_mode);
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -1416,7 +1426,7 @@ static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev)
|
||||
host->mmc = mmc;
|
||||
host->pdev = pdev;
|
||||
host->cookie = -1;
|
||||
host->power_state = SDMMC_POWER_OFF;
|
||||
host->prev_power_state = MMC_POWER_OFF;
|
||||
INIT_WORK(&host->work, sd_request);
|
||||
platform_set_drvdata(pdev, host);
|
||||
pcr->slots[RTSX_SD_CARD].p_dev = pdev;
|
||||
|
||||
@@ -399,7 +399,8 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,
|
||||
dma_addr_t dma_addr;
|
||||
dma_cookie_t cookie;
|
||||
uint32_t reg;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
unsigned long time_left;
|
||||
|
||||
if (dir == DMA_FROM_DEVICE) {
|
||||
chan = flctl->chan_fifo0_rx;
|
||||
@@ -440,13 +441,14 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret =
|
||||
time_left =
|
||||
wait_for_completion_timeout(&flctl->dma_complete,
|
||||
msecs_to_jiffies(3000));
|
||||
|
||||
if (ret <= 0) {
|
||||
if (time_left == 0) {
|
||||
dmaengine_terminate_all(chan);
|
||||
dev_err(&flctl->pdev->dev, "wait_for_completion_timeout\n");
|
||||
ret = -ETIMEDOUT;
|
||||
}
|
||||
|
||||
out:
|
||||
@@ -456,7 +458,7 @@ out:
|
||||
|
||||
dma_unmap_single(chan->device->dev, dma_addr, len, dir);
|
||||
|
||||
/* ret > 0 is success */
|
||||
/* ret == 0 is success */
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -480,7 +482,7 @@ static void read_fiforeg(struct sh_flctl *flctl, int rlen, int offset)
|
||||
|
||||
/* initiate DMA transfer */
|
||||
if (flctl->chan_fifo0_rx && rlen >= 32 &&
|
||||
flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_FROM_DEVICE) > 0)
|
||||
!flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_FROM_DEVICE))
|
||||
goto convert; /* DMA success */
|
||||
|
||||
/* do polling transfer */
|
||||
@@ -539,7 +541,7 @@ static void write_ec_fiforeg(struct sh_flctl *flctl, int rlen,
|
||||
|
||||
/* initiate DMA transfer */
|
||||
if (flctl->chan_fifo0_tx && rlen >= 32 &&
|
||||
flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_TO_DEVICE) > 0)
|
||||
!flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_TO_DEVICE))
|
||||
return; /* DMA success */
|
||||
|
||||
/* do polling transfer */
|
||||
|
||||
@@ -245,13 +245,14 @@ struct grcan_device_config {
|
||||
.rxsize = GRCAN_DEFAULT_BUFFER_SIZE, \
|
||||
}
|
||||
|
||||
#define GRCAN_TXBUG_SAFE_GRLIB_VERSION 0x4100
|
||||
#define GRCAN_TXBUG_SAFE_GRLIB_VERSION 4100
|
||||
#define GRLIB_VERSION_MASK 0xffff
|
||||
|
||||
/* GRCAN private data structure */
|
||||
struct grcan_priv {
|
||||
struct can_priv can; /* must be the first member */
|
||||
struct net_device *dev;
|
||||
struct device *ofdev_dev;
|
||||
struct napi_struct napi;
|
||||
|
||||
struct grcan_registers __iomem *regs; /* ioremap'ed registers */
|
||||
@@ -928,7 +929,7 @@ static void grcan_free_dma_buffers(struct net_device *dev)
|
||||
struct grcan_priv *priv = netdev_priv(dev);
|
||||
struct grcan_dma *dma = &priv->dma;
|
||||
|
||||
dma_free_coherent(&dev->dev, dma->base_size, dma->base_buf,
|
||||
dma_free_coherent(priv->ofdev_dev, dma->base_size, dma->base_buf,
|
||||
dma->base_handle);
|
||||
memset(dma, 0, sizeof(*dma));
|
||||
}
|
||||
@@ -953,7 +954,7 @@ static int grcan_allocate_dma_buffers(struct net_device *dev,
|
||||
|
||||
/* Extra GRCAN_BUFFER_ALIGNMENT to allow for alignment */
|
||||
dma->base_size = lsize + ssize + GRCAN_BUFFER_ALIGNMENT;
|
||||
dma->base_buf = dma_alloc_coherent(&dev->dev,
|
||||
dma->base_buf = dma_alloc_coherent(priv->ofdev_dev,
|
||||
dma->base_size,
|
||||
&dma->base_handle,
|
||||
GFP_KERNEL);
|
||||
@@ -1117,8 +1118,10 @@ static int grcan_close(struct net_device *dev)
|
||||
|
||||
priv->closing = true;
|
||||
if (priv->need_txbug_workaround) {
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
del_timer_sync(&priv->hang_timer);
|
||||
del_timer_sync(&priv->rr_timer);
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
}
|
||||
netif_stop_queue(dev);
|
||||
grcan_stop_hardware(dev);
|
||||
@@ -1138,7 +1141,7 @@ static int grcan_close(struct net_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int grcan_transmit_catch_up(struct net_device *dev, int budget)
|
||||
static void grcan_transmit_catch_up(struct net_device *dev)
|
||||
{
|
||||
struct grcan_priv *priv = netdev_priv(dev);
|
||||
unsigned long flags;
|
||||
@@ -1146,7 +1149,7 @@ static int grcan_transmit_catch_up(struct net_device *dev, int budget)
|
||||
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
|
||||
work_done = catch_up_echo_skb(dev, budget, true);
|
||||
work_done = catch_up_echo_skb(dev, -1, true);
|
||||
if (work_done) {
|
||||
if (!priv->resetting && !priv->closing &&
|
||||
!(priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY))
|
||||
@@ -1160,8 +1163,6 @@ static int grcan_transmit_catch_up(struct net_device *dev, int budget)
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
|
||||
return work_done;
|
||||
}
|
||||
|
||||
static int grcan_receive(struct net_device *dev, int budget)
|
||||
@@ -1243,19 +1244,13 @@ static int grcan_poll(struct napi_struct *napi, int budget)
|
||||
struct net_device *dev = priv->dev;
|
||||
struct grcan_registers __iomem *regs = priv->regs;
|
||||
unsigned long flags;
|
||||
int tx_work_done, rx_work_done;
|
||||
int rx_budget = budget / 2;
|
||||
int tx_budget = budget - rx_budget;
|
||||
int work_done;
|
||||
|
||||
/* Half of the budget for receiveing messages */
|
||||
rx_work_done = grcan_receive(dev, rx_budget);
|
||||
work_done = grcan_receive(dev, budget);
|
||||
|
||||
/* Half of the budget for transmitting messages as that can trigger echo
|
||||
* frames being received
|
||||
*/
|
||||
tx_work_done = grcan_transmit_catch_up(dev, tx_budget);
|
||||
grcan_transmit_catch_up(dev);
|
||||
|
||||
if (rx_work_done < rx_budget && tx_work_done < tx_budget) {
|
||||
if (work_done < budget) {
|
||||
napi_complete(napi);
|
||||
|
||||
/* Guarantee no interference with a running reset that otherwise
|
||||
@@ -1272,7 +1267,7 @@ static int grcan_poll(struct napi_struct *napi, int budget)
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
}
|
||||
|
||||
return rx_work_done + tx_work_done;
|
||||
return work_done;
|
||||
}
|
||||
|
||||
/* Work tx bug by waiting while for the risky situation to clear. If that fails,
|
||||
@@ -1604,6 +1599,7 @@ static int grcan_setup_netdev(struct platform_device *ofdev,
|
||||
memcpy(&priv->config, &grcan_module_config,
|
||||
sizeof(struct grcan_device_config));
|
||||
priv->dev = dev;
|
||||
priv->ofdev_dev = &ofdev->dev;
|
||||
priv->regs = base;
|
||||
priv->can.bittiming_const = &grcan_bittiming_const;
|
||||
priv->can.do_set_bittiming = grcan_set_bittiming;
|
||||
@@ -1661,6 +1657,7 @@ exit_free_candev:
|
||||
static int grcan_probe(struct platform_device *ofdev)
|
||||
{
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct device_node *sysid_parent;
|
||||
struct resource *res;
|
||||
u32 sysid, ambafreq;
|
||||
int irq, err;
|
||||
@@ -1670,10 +1667,15 @@ static int grcan_probe(struct platform_device *ofdev)
|
||||
/* Compare GRLIB version number with the first that does not
|
||||
* have the tx bug (see start_xmit)
|
||||
*/
|
||||
err = of_property_read_u32(np, "systemid", &sysid);
|
||||
if (!err && ((sysid & GRLIB_VERSION_MASK)
|
||||
>= GRCAN_TXBUG_SAFE_GRLIB_VERSION))
|
||||
txbug = false;
|
||||
sysid_parent = of_find_node_by_path("/ambapp0");
|
||||
if (sysid_parent) {
|
||||
of_node_get(sysid_parent);
|
||||
err = of_property_read_u32(sysid_parent, "systemid", &sysid);
|
||||
if (!err && ((sysid & GRLIB_VERSION_MASK) >=
|
||||
GRCAN_TXBUG_SAFE_GRLIB_VERSION))
|
||||
txbug = false;
|
||||
of_node_put(sysid_parent);
|
||||
}
|
||||
|
||||
err = of_property_read_u32(np, "freq", &ambafreq);
|
||||
if (err) {
|
||||
|
||||
@@ -681,9 +681,20 @@ static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb,
|
||||
atomic_inc(&priv->active_tx_urbs);
|
||||
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (unlikely(err))
|
||||
goto failed;
|
||||
else if (atomic_read(&priv->active_tx_urbs) >= MAX_TX_URBS)
|
||||
if (unlikely(err)) {
|
||||
can_free_echo_skb(netdev, context->echo_index);
|
||||
|
||||
usb_unanchor_urb(urb);
|
||||
usb_free_coherent(priv->udev, size, buf, urb->transfer_dma);
|
||||
|
||||
atomic_dec(&priv->active_tx_urbs);
|
||||
|
||||
if (err == -ENODEV)
|
||||
netif_device_detach(netdev);
|
||||
else
|
||||
netdev_warn(netdev, "failed tx_urb %d\n", err);
|
||||
stats->tx_dropped++;
|
||||
} else if (atomic_read(&priv->active_tx_urbs) >= MAX_TX_URBS)
|
||||
/* Slow down tx path */
|
||||
netif_stop_queue(netdev);
|
||||
|
||||
@@ -702,19 +713,6 @@ nofreecontext:
|
||||
|
||||
return NETDEV_TX_BUSY;
|
||||
|
||||
failed:
|
||||
can_free_echo_skb(netdev, context->echo_index);
|
||||
|
||||
usb_unanchor_urb(urb);
|
||||
usb_free_coherent(priv->udev, size, buf, urb->transfer_dma);
|
||||
|
||||
atomic_dec(&priv->active_tx_urbs);
|
||||
|
||||
if (err == -ENODEV)
|
||||
netif_device_detach(netdev);
|
||||
else
|
||||
netdev_warn(netdev, "failed tx_urb %d\n", err);
|
||||
|
||||
nomembuf:
|
||||
usb_free_urb(urb);
|
||||
|
||||
|
||||
@@ -625,6 +625,13 @@ static int hw_atl_b0_hw_ring_tx_head_update(struct aq_hw_s *self,
|
||||
err = -ENXIO;
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
/* Validate that the new hw_head_ is reasonable. */
|
||||
if (hw_head_ >= ring->size) {
|
||||
err = -ENXIO;
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
ring->hw_head = hw_head_;
|
||||
err = aq_hw_err_from_flags(self);
|
||||
|
||||
|
||||
@@ -14317,10 +14317,6 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp)
|
||||
|
||||
/* Stop Tx */
|
||||
bnx2x_tx_disable(bp);
|
||||
/* Delete all NAPI objects */
|
||||
bnx2x_del_all_napi(bp);
|
||||
if (CNIC_LOADED(bp))
|
||||
bnx2x_del_all_napi_cnic(bp);
|
||||
netdev_reset_tc(bp->dev);
|
||||
|
||||
del_timer_sync(&bp->timer);
|
||||
@@ -14425,6 +14421,11 @@ static pci_ers_result_t bnx2x_io_slot_reset(struct pci_dev *pdev)
|
||||
bnx2x_drain_tx_queues(bp);
|
||||
bnx2x_send_unload_req(bp, UNLOAD_RECOVERY);
|
||||
bnx2x_netif_stop(bp, 1);
|
||||
bnx2x_del_all_napi(bp);
|
||||
|
||||
if (CNIC_LOADED(bp))
|
||||
bnx2x_del_all_napi_cnic(bp);
|
||||
|
||||
bnx2x_free_irq(bp);
|
||||
|
||||
/* Report UNLOAD_DONE to MCP */
|
||||
|
||||
@@ -1522,6 +1522,11 @@ static struct sk_buff *bcmgenet_put_tx_csum(struct net_device *dev,
|
||||
return skb;
|
||||
}
|
||||
|
||||
static void bcmgenet_hide_tsb(struct sk_buff *skb)
|
||||
{
|
||||
__skb_pull(skb, sizeof(struct status_64));
|
||||
}
|
||||
|
||||
static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
struct bcmgenet_priv *priv = netdev_priv(dev);
|
||||
@@ -1632,6 +1637,8 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
}
|
||||
|
||||
GENET_CB(skb)->last_cb = tx_cb_ptr;
|
||||
|
||||
bcmgenet_hide_tsb(skb);
|
||||
skb_tx_timestamp(skb);
|
||||
|
||||
/* Decrement total BD count and advance our write pointer */
|
||||
|
||||
@@ -1265,6 +1265,7 @@ static void macb_tx_restart(struct macb_queue *queue)
|
||||
unsigned int head = queue->tx_head;
|
||||
unsigned int tail = queue->tx_tail;
|
||||
struct macb *bp = queue->bp;
|
||||
unsigned int head_idx, tbqp;
|
||||
|
||||
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
|
||||
queue_writel(queue, ISR, MACB_BIT(TXUBR));
|
||||
@@ -1272,6 +1273,13 @@ static void macb_tx_restart(struct macb_queue *queue)
|
||||
if (head == tail)
|
||||
return;
|
||||
|
||||
tbqp = queue_readl(queue, TBQP) / macb_dma_desc_get_size(bp);
|
||||
tbqp = macb_adj_dma_desc_idx(bp, macb_tx_ring_wrap(bp, tbqp));
|
||||
head_idx = macb_adj_dma_desc_idx(bp, macb_tx_ring_wrap(bp, head));
|
||||
|
||||
if (tbqp == head_idx)
|
||||
return;
|
||||
|
||||
macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TSTART));
|
||||
}
|
||||
|
||||
|
||||
@@ -1410,8 +1410,10 @@ static int tulip_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
|
||||
/* alloc_etherdev ensures aligned and zeroed private structures */
|
||||
dev = alloc_etherdev (sizeof (*tp));
|
||||
if (!dev)
|
||||
if (!dev) {
|
||||
pci_disable_device(pdev);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||
if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) {
|
||||
@@ -1789,6 +1791,7 @@ err_out_free_res:
|
||||
|
||||
err_out_free_netdev:
|
||||
free_netdev (dev);
|
||||
pci_disable_device(pdev);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
||||
@@ -1013,8 +1013,8 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
|
||||
{
|
||||
u32 reg = link << (E1000_LTRV_REQ_SHIFT + E1000_LTRV_NOSNOOP_SHIFT) |
|
||||
link << E1000_LTRV_REQ_SHIFT | E1000_LTRV_SEND;
|
||||
u16 max_ltr_enc_d = 0; /* maximum LTR decoded by platform */
|
||||
u16 lat_enc_d = 0; /* latency decoded */
|
||||
u32 max_ltr_enc_d = 0; /* maximum LTR decoded by platform */
|
||||
u32 lat_enc_d = 0; /* latency decoded */
|
||||
u16 lat_enc = 0; /* latency encoded */
|
||||
|
||||
if (link) {
|
||||
|
||||
@@ -4622,7 +4622,8 @@ static void igb_watchdog_task(struct work_struct *work)
|
||||
break;
|
||||
}
|
||||
|
||||
if (adapter->link_speed != SPEED_1000)
|
||||
if (adapter->link_speed != SPEED_1000 ||
|
||||
!hw->phy.ops.read_reg)
|
||||
goto no_wait;
|
||||
|
||||
/* wait for Remote receiver status OK */
|
||||
|
||||
@@ -45,7 +45,6 @@ config KS8851
|
||||
config KS8851_MLL
|
||||
tristate "Micrel KS8851 MLL"
|
||||
depends on HAS_IOMEM
|
||||
depends on PTP_1588_CLOCK_OPTIONAL
|
||||
select MII
|
||||
---help---
|
||||
This platform driver is for Micrel KS8851 Address/data bus
|
||||
|
||||
@@ -3629,7 +3629,8 @@ static void ql_reset_work(struct work_struct *work)
|
||||
qdev->mem_map_registers;
|
||||
unsigned long hw_flags;
|
||||
|
||||
if (test_bit((QL_RESET_PER_SCSI | QL_RESET_START), &qdev->flags)) {
|
||||
if (test_bit(QL_RESET_PER_SCSI, &qdev->flags) ||
|
||||
test_bit(QL_RESET_START, &qdev->flags)) {
|
||||
clear_bit(QL_LINK_MASTER, &qdev->flags);
|
||||
|
||||
/*
|
||||
|
||||
@@ -5956,6 +5956,11 @@ static int efx_ef10_mtd_probe(struct efx_nic *efx)
|
||||
n_parts++;
|
||||
}
|
||||
|
||||
if (!n_parts) {
|
||||
kfree(parts);
|
||||
return 0;
|
||||
}
|
||||
|
||||
rc = efx_mtd_add(efx, &parts[0].common, n_parts, sizeof(*parts));
|
||||
fail:
|
||||
if (rc)
|
||||
|
||||
@@ -2446,7 +2446,7 @@ static int smsc911x_drv_probe(struct platform_device *pdev)
|
||||
if (irq == -EPROBE_DEFER) {
|
||||
retval = -EPROBE_DEFER;
|
||||
goto out_0;
|
||||
} else if (irq <= 0) {
|
||||
} else if (irq < 0) {
|
||||
pr_warn("Could not allocate irq resource\n");
|
||||
retval = -ENODEV;
|
||||
goto out_0;
|
||||
|
||||
@@ -68,6 +68,10 @@
|
||||
#define TSE_PCS_USE_SGMII_ENA BIT(0)
|
||||
#define TSE_PCS_IF_USE_SGMII 0x03
|
||||
|
||||
#define SGMII_ADAPTER_CTRL_REG 0x00
|
||||
#define SGMII_ADAPTER_DISABLE 0x0001
|
||||
#define SGMII_ADAPTER_ENABLE 0x0000
|
||||
|
||||
#define AUTONEGO_LINK_TIMER 20
|
||||
|
||||
static int tse_pcs_reset(void __iomem *base, struct tse_pcs *pcs)
|
||||
@@ -211,8 +215,12 @@ void tse_pcs_fix_mac_speed(struct tse_pcs *pcs, struct phy_device *phy_dev,
|
||||
unsigned int speed)
|
||||
{
|
||||
void __iomem *tse_pcs_base = pcs->tse_pcs_base;
|
||||
void __iomem *sgmii_adapter_base = pcs->sgmii_adapter_base;
|
||||
u32 val;
|
||||
|
||||
writew(SGMII_ADAPTER_ENABLE,
|
||||
sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG);
|
||||
|
||||
pcs->autoneg = phy_dev->autoneg;
|
||||
|
||||
if (phy_dev->autoneg == AUTONEG_ENABLE) {
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
#include <linux/phy.h>
|
||||
#include <linux/timer.h>
|
||||
|
||||
#define SGMII_ADAPTER_CTRL_REG 0x00
|
||||
#define SGMII_ADAPTER_ENABLE 0x0000
|
||||
#define SGMII_ADAPTER_DISABLE 0x0001
|
||||
|
||||
struct tse_pcs {
|
||||
struct device *dev;
|
||||
void __iomem *tse_pcs_base;
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
|
||||
#include "altr_tse_pcs.h"
|
||||
|
||||
#define SGMII_ADAPTER_CTRL_REG 0x00
|
||||
#define SGMII_ADAPTER_DISABLE 0x0001
|
||||
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII 0x0
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII 0x1
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RMII 0x2
|
||||
@@ -62,14 +65,16 @@ static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed)
|
||||
{
|
||||
struct socfpga_dwmac *dwmac = (struct socfpga_dwmac *)priv;
|
||||
void __iomem *splitter_base = dwmac->splitter_base;
|
||||
void __iomem *tse_pcs_base = dwmac->pcs.tse_pcs_base;
|
||||
void __iomem *sgmii_adapter_base = dwmac->pcs.sgmii_adapter_base;
|
||||
struct device *dev = dwmac->dev;
|
||||
struct net_device *ndev = dev_get_drvdata(dev);
|
||||
struct phy_device *phy_dev = ndev->phydev;
|
||||
u32 val;
|
||||
|
||||
writew(SGMII_ADAPTER_DISABLE,
|
||||
sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG);
|
||||
if ((tse_pcs_base) && (sgmii_adapter_base))
|
||||
writew(SGMII_ADAPTER_DISABLE,
|
||||
sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG);
|
||||
|
||||
if (splitter_base) {
|
||||
val = readl(splitter_base + EMAC_SPLITTER_CTRL_REG);
|
||||
@@ -91,9 +96,7 @@ static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed)
|
||||
writel(val, splitter_base + EMAC_SPLITTER_CTRL_REG);
|
||||
}
|
||||
|
||||
writew(SGMII_ADAPTER_ENABLE,
|
||||
sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG);
|
||||
if (phy_dev)
|
||||
if (tse_pcs_base && sgmii_adapter_base)
|
||||
tse_pcs_fix_mac_speed(&dwmac->pcs, phy_dev, speed);
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ static int stmmac_pci_probe(struct pci_dev *pdev,
|
||||
return -ENOMEM;
|
||||
|
||||
/* Enable pci device */
|
||||
ret = pci_enable_device(pdev);
|
||||
ret = pcim_enable_device(pdev);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "%s: ERROR: failed to enable device\n",
|
||||
__func__);
|
||||
@@ -313,8 +313,6 @@ static void stmmac_pci_remove(struct pci_dev *pdev)
|
||||
pcim_iounmap_regions(pdev, BIT(i));
|
||||
break;
|
||||
}
|
||||
|
||||
pci_disable_device(pdev);
|
||||
}
|
||||
|
||||
static int __maybe_unused stmmac_pci_suspend(struct device *dev)
|
||||
|
||||
@@ -817,10 +817,10 @@ static int xemaclite_mdio_write(struct mii_bus *bus, int phy_id, int reg,
|
||||
static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
|
||||
{
|
||||
struct mii_bus *bus;
|
||||
int rc;
|
||||
struct resource res;
|
||||
struct device_node *np = of_get_parent(lp->phy_node);
|
||||
struct device_node *npp;
|
||||
int rc, ret;
|
||||
|
||||
/* Don't register the MDIO bus if the phy_node or its parent node
|
||||
* can't be found.
|
||||
@@ -830,8 +830,14 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
|
||||
return -ENODEV;
|
||||
}
|
||||
npp = of_get_parent(np);
|
||||
|
||||
of_address_to_resource(npp, 0, &res);
|
||||
ret = of_address_to_resource(npp, 0, &res);
|
||||
of_node_put(npp);
|
||||
if (ret) {
|
||||
dev_err(dev, "%s resource error!\n",
|
||||
dev->of_node->full_name);
|
||||
of_node_put(np);
|
||||
return ret;
|
||||
}
|
||||
if (lp->ndev->mem_start != res.start) {
|
||||
struct phy_device *phydev;
|
||||
phydev = of_phy_find_device(lp->phy_node);
|
||||
@@ -840,6 +846,7 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
|
||||
"MDIO of the phy is not registered yet\n");
|
||||
else
|
||||
put_device(&phydev->mdio.dev);
|
||||
of_node_put(np);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -852,6 +859,7 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
|
||||
bus = mdiobus_alloc();
|
||||
if (!bus) {
|
||||
dev_err(dev, "Failed to allocate mdiobus\n");
|
||||
of_node_put(np);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@@ -866,6 +874,7 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
|
||||
lp->mii_bus = bus;
|
||||
|
||||
rc = of_mdiobus_register(bus, np);
|
||||
of_node_put(np);
|
||||
if (rc) {
|
||||
dev_err(dev, "Failed to register mdio bus.\n");
|
||||
goto err_register;
|
||||
|
||||
@@ -311,7 +311,6 @@ static void sp_setup(struct net_device *dev)
|
||||
{
|
||||
/* Finish setting up the DEVICE info. */
|
||||
dev->netdev_ops = &sp_netdev_ops;
|
||||
dev->needs_free_netdev = true;
|
||||
dev->mtu = SIXP_MTU;
|
||||
dev->hard_header_len = AX25_MAX_HEADER_LEN;
|
||||
dev->header_ops = &ax25_header_ops;
|
||||
@@ -690,9 +689,11 @@ static void sixpack_close(struct tty_struct *tty)
|
||||
del_timer_sync(&sp->tx_t);
|
||||
del_timer_sync(&sp->resync_t);
|
||||
|
||||
/* Free all 6pack frame buffers. */
|
||||
/* Free all 6pack frame buffers after unreg. */
|
||||
kfree(sp->rbuff);
|
||||
kfree(sp->xbuff);
|
||||
|
||||
free_netdev(sp->dev);
|
||||
}
|
||||
|
||||
/* Perform I/O control on an active 6pack channel. */
|
||||
|
||||
@@ -1354,7 +1354,9 @@ static int rr_close(struct net_device *dev)
|
||||
|
||||
rrpriv->fw_running = 0;
|
||||
|
||||
spin_unlock_irqrestore(&rrpriv->lock, flags);
|
||||
del_timer_sync(&rrpriv->timer);
|
||||
spin_lock_irqsave(&rrpriv->lock, flags);
|
||||
|
||||
writel(0, ®s->TxPi);
|
||||
writel(0, ®s->IpRxPi);
|
||||
|
||||
@@ -595,6 +595,7 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx,
|
||||
if (dma_mapping_error(&adapter->pdev->dev,
|
||||
rbi->dma_addr)) {
|
||||
dev_kfree_skb_any(rbi->skb);
|
||||
rbi->skb = NULL;
|
||||
rq->stats.rx_buf_alloc_failure++;
|
||||
break;
|
||||
}
|
||||
@@ -619,6 +620,7 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx,
|
||||
if (dma_mapping_error(&adapter->pdev->dev,
|
||||
rbi->dma_addr)) {
|
||||
put_page(rbi->page);
|
||||
rbi->page = NULL;
|
||||
rq->stats.rx_buf_alloc_failure++;
|
||||
break;
|
||||
}
|
||||
@@ -1571,6 +1573,10 @@ vmxnet3_rq_cleanup(struct vmxnet3_rx_queue *rq,
|
||||
u32 i, ring_idx;
|
||||
struct Vmxnet3_RxDesc *rxd;
|
||||
|
||||
/* ring has already been cleaned up */
|
||||
if (!rq->rx_ring[0].base)
|
||||
return;
|
||||
|
||||
for (ring_idx = 0; ring_idx < 2; ring_idx++) {
|
||||
for (i = 0; i < rq->rx_ring[ring_idx].size; i++) {
|
||||
#ifdef __BIG_ENDIAN_BITFIELD
|
||||
|
||||
@@ -524,11 +524,11 @@ static int vxlan_fdb_append(struct vxlan_fdb *f,
|
||||
|
||||
rd = kmalloc(sizeof(*rd), GFP_ATOMIC);
|
||||
if (rd == NULL)
|
||||
return -ENOBUFS;
|
||||
return -ENOMEM;
|
||||
|
||||
if (dst_cache_init(&rd->dst_cache, GFP_ATOMIC)) {
|
||||
kfree(rd);
|
||||
return -ENOBUFS;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
rd->remote_ip = *ip;
|
||||
|
||||
@@ -552,7 +552,7 @@ enum brcmf_sdio_frmtype {
|
||||
BRCMF_SDIO_FT_SUB,
|
||||
};
|
||||
|
||||
#define SDIOD_DRVSTR_KEY(chip, pmu) (((chip) << 16) | (pmu))
|
||||
#define SDIOD_DRVSTR_KEY(chip, pmu) (((unsigned int)(chip) << 16) | (pmu))
|
||||
|
||||
/* SDIO Pad drive strength to select value mappings */
|
||||
struct sdiod_drive_str {
|
||||
|
||||
@@ -2025,11 +2025,13 @@ static void hw_scan_work(struct work_struct *work)
|
||||
if (req->ie_len)
|
||||
skb_put_data(probe, req->ie, req->ie_len);
|
||||
|
||||
rcu_read_lock();
|
||||
if (!ieee80211_tx_prepare_skb(hwsim->hw,
|
||||
hwsim->hw_scan_vif,
|
||||
probe,
|
||||
hwsim->tmp_chan->band,
|
||||
NULL)) {
|
||||
rcu_read_unlock();
|
||||
kfree_skb(probe);
|
||||
continue;
|
||||
}
|
||||
@@ -2037,6 +2039,7 @@ static void hw_scan_work(struct work_struct *work)
|
||||
local_bh_disable();
|
||||
mac80211_hwsim_tx_frame(hwsim->hw, probe,
|
||||
hwsim->tmp_chan);
|
||||
rcu_read_unlock();
|
||||
local_bh_enable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,6 +194,7 @@ void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv)
|
||||
{
|
||||
struct nci_dev *ndev = priv->ndev;
|
||||
|
||||
nci_unregister_device(ndev);
|
||||
if (priv->ndev->nfc_dev->fw_download_in_progress)
|
||||
nfcmrvl_fw_dnld_abort(priv);
|
||||
|
||||
@@ -202,7 +203,6 @@ void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv)
|
||||
if (gpio_is_valid(priv->config.reset_n_io))
|
||||
gpio_free(priv->config.reset_n_io);
|
||||
|
||||
nci_unregister_device(ndev);
|
||||
nci_free_device(ndev);
|
||||
kfree(priv);
|
||||
}
|
||||
|
||||
@@ -104,6 +104,7 @@
|
||||
#define PCIE_MSI_ADDR_HIGH_REG (CONTROL_BASE_ADDR + 0x54)
|
||||
#define PCIE_MSI_STATUS_REG (CONTROL_BASE_ADDR + 0x58)
|
||||
#define PCIE_MSI_MASK_REG (CONTROL_BASE_ADDR + 0x5C)
|
||||
#define PCIE_MSI_ALL_MASK GENMASK(31, 0)
|
||||
#define PCIE_MSI_PAYLOAD_REG (CONTROL_BASE_ADDR + 0x9C)
|
||||
#define PCIE_MSI_DATA_MASK GENMASK(15, 0)
|
||||
|
||||
@@ -490,6 +491,7 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie)
|
||||
advk_writel(pcie, reg, PCIE_CORE_CTRL2_REG);
|
||||
|
||||
/* Clear all interrupts */
|
||||
advk_writel(pcie, PCIE_MSI_ALL_MASK, PCIE_MSI_STATUS_REG);
|
||||
advk_writel(pcie, PCIE_ISR0_ALL_MASK, PCIE_ISR0_REG);
|
||||
advk_writel(pcie, PCIE_ISR1_ALL_MASK, PCIE_ISR1_REG);
|
||||
advk_writel(pcie, PCIE_IRQ_ALL_MASK, HOST_CTRL_INT_STATUS_REG);
|
||||
@@ -502,7 +504,7 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie)
|
||||
advk_writel(pcie, PCIE_ISR1_ALL_MASK, PCIE_ISR1_MASK_REG);
|
||||
|
||||
/* Unmask all MSI's */
|
||||
advk_writel(pcie, 0, PCIE_MSI_MASK_REG);
|
||||
advk_writel(pcie, ~(u32)PCIE_MSI_ALL_MASK, PCIE_MSI_MASK_REG);
|
||||
|
||||
/* Enable summary interrupt for GIC SPI source */
|
||||
reg = PCIE_IRQ_ALL_MASK & (~PCIE_IRQ_ENABLE_INTS_MASK);
|
||||
@@ -1034,23 +1036,19 @@ static void advk_pcie_remove_irq_domain(struct advk_pcie *pcie)
|
||||
static void advk_pcie_handle_msi(struct advk_pcie *pcie)
|
||||
{
|
||||
u32 msi_val, msi_mask, msi_status, msi_idx;
|
||||
u16 msi_data;
|
||||
int virq;
|
||||
|
||||
msi_mask = advk_readl(pcie, PCIE_MSI_MASK_REG);
|
||||
msi_val = advk_readl(pcie, PCIE_MSI_STATUS_REG);
|
||||
msi_status = msi_val & ~msi_mask;
|
||||
msi_status = msi_val & ((~msi_mask) & PCIE_MSI_ALL_MASK);
|
||||
|
||||
for (msi_idx = 0; msi_idx < MSI_IRQ_NUM; msi_idx++) {
|
||||
if (!(BIT(msi_idx) & msi_status))
|
||||
continue;
|
||||
|
||||
/*
|
||||
* msi_idx contains bits [4:0] of the msi_data and msi_data
|
||||
* contains 16bit MSI interrupt number
|
||||
*/
|
||||
advk_writel(pcie, BIT(msi_idx), PCIE_MSI_STATUS_REG);
|
||||
msi_data = advk_readl(pcie, PCIE_MSI_PAYLOAD_REG) & PCIE_MSI_DATA_MASK;
|
||||
generic_handle_irq(msi_data);
|
||||
virq = irq_find_mapping(pcie->msi_inner_domain, msi_idx);
|
||||
generic_handle_irq(virq);
|
||||
}
|
||||
|
||||
advk_writel(pcie, PCIE_ISR0_MSI_INT_PENDING,
|
||||
|
||||
@@ -193,6 +193,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
|
||||
sata_phy->client = of_find_i2c_device_by_node(node);
|
||||
of_node_put(node);
|
||||
if (!sata_phy->client)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
@@ -201,20 +202,21 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
|
||||
sata_phy->phyclk = devm_clk_get(dev, "sata_phyctrl");
|
||||
if (IS_ERR(sata_phy->phyclk)) {
|
||||
dev_err(dev, "failed to get clk for PHY\n");
|
||||
return PTR_ERR(sata_phy->phyclk);
|
||||
ret = PTR_ERR(sata_phy->phyclk);
|
||||
goto put_dev;
|
||||
}
|
||||
|
||||
ret = clk_prepare_enable(sata_phy->phyclk);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "failed to enable source clk\n");
|
||||
return ret;
|
||||
goto put_dev;
|
||||
}
|
||||
|
||||
sata_phy->phy = devm_phy_create(dev, NULL, &exynos_sata_phy_ops);
|
||||
if (IS_ERR(sata_phy->phy)) {
|
||||
clk_disable_unprepare(sata_phy->phyclk);
|
||||
dev_err(dev, "failed to create PHY\n");
|
||||
return PTR_ERR(sata_phy->phy);
|
||||
ret = PTR_ERR(sata_phy->phy);
|
||||
goto clk_disable;
|
||||
}
|
||||
|
||||
phy_set_drvdata(sata_phy->phy, sata_phy);
|
||||
@@ -222,11 +224,18 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
|
||||
phy_provider = devm_of_phy_provider_register(dev,
|
||||
of_phy_simple_xlate);
|
||||
if (IS_ERR(phy_provider)) {
|
||||
clk_disable_unprepare(sata_phy->phyclk);
|
||||
return PTR_ERR(phy_provider);
|
||||
ret = PTR_ERR(phy_provider);
|
||||
goto clk_disable;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
clk_disable:
|
||||
clk_disable_unprepare(sata_phy->phyclk);
|
||||
put_dev:
|
||||
put_device(&sata_phy->client->dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct of_device_id exynos_sata_phy_of_match[] = {
|
||||
|
||||
@@ -1374,10 +1374,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
|
||||
}
|
||||
|
||||
irq = irq_of_parse_and_map(child, 0);
|
||||
if (irq < 0) {
|
||||
dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq);
|
||||
if (!irq) {
|
||||
dev_err(pctl->dev, "No IRQ for bank %u\n", i);
|
||||
of_node_put(child);
|
||||
ret = irq;
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
||||
@@ -1125,8 +1125,6 @@ static void kbd_led_set(struct led_classdev *led_cdev,
|
||||
|
||||
if (value > samsung->kbd_led.max_brightness)
|
||||
value = samsung->kbd_led.max_brightness;
|
||||
else if (value < 0)
|
||||
value = 0;
|
||||
|
||||
samsung->kbd_led_wk = value;
|
||||
queue_work(samsung->led_workqueue, &samsung->kbd_led_work);
|
||||
|
||||
@@ -625,8 +625,6 @@ static void mpc_rcvd_sweep_resp(struct mpcg_info *mpcginfo)
|
||||
ctcm_clear_busy_do(dev);
|
||||
}
|
||||
|
||||
kfree(mpcginfo);
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
@@ -1205,10 +1203,10 @@ static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
|
||||
CTCM_FUNTAIL, dev->name);
|
||||
priv->stats.rx_dropped++;
|
||||
/* mpcginfo only used for non-data transfers */
|
||||
kfree(mpcginfo);
|
||||
if (do_debug_data)
|
||||
ctcmpc_dump_skb(pskb, -8);
|
||||
}
|
||||
kfree(mpcginfo);
|
||||
}
|
||||
done:
|
||||
|
||||
@@ -1991,7 +1989,6 @@ static void mpc_action_rcvd_xid0(fsm_instance *fsm, int event, void *arg)
|
||||
}
|
||||
break;
|
||||
}
|
||||
kfree(mpcginfo);
|
||||
|
||||
CTCM_PR_DEBUG("ctcmpc:%s() %s xid2:%i xid7:%i xidt_p2:%i \n",
|
||||
__func__, ch->id, grp->outstanding_xid2,
|
||||
@@ -2052,7 +2049,6 @@ static void mpc_action_rcvd_xid7(fsm_instance *fsm, int event, void *arg)
|
||||
mpc_validate_xid(mpcginfo);
|
||||
break;
|
||||
}
|
||||
kfree(mpcginfo);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,11 +39,12 @@ static ssize_t ctcm_buffer_write(struct device *dev,
|
||||
struct ctcm_priv *priv = dev_get_drvdata(dev);
|
||||
int rc;
|
||||
|
||||
ndev = priv->channel[CTCM_READ]->netdev;
|
||||
if (!(priv && priv->channel[CTCM_READ] && ndev)) {
|
||||
if (!(priv && priv->channel[CTCM_READ] &&
|
||||
priv->channel[CTCM_READ]->netdev)) {
|
||||
CTCM_DBF_TEXT(SETUP, CTC_DBF_ERROR, "bfnondev");
|
||||
return -ENODEV;
|
||||
}
|
||||
ndev = priv->channel[CTCM_READ]->netdev;
|
||||
|
||||
rc = kstrtouint(buf, 0, &bs1);
|
||||
if (rc)
|
||||
|
||||
@@ -1757,10 +1757,11 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd)
|
||||
lcs_schedule_recovery(card);
|
||||
break;
|
||||
case LCS_CMD_STOPLAN:
|
||||
pr_warn("Stoplan for %s initiated by LGW\n",
|
||||
card->dev->name);
|
||||
if (card->dev)
|
||||
if (card->dev) {
|
||||
pr_warn("Stoplan for %s initiated by LGW\n",
|
||||
card->dev->name);
|
||||
netif_carrier_off(card->dev);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LCS_DBF_TEXT(5, trace, "noLGWcmd");
|
||||
|
||||
@@ -3639,6 +3639,9 @@ int qlt_abort_cmd(struct qla_tgt_cmd *cmd)
|
||||
|
||||
spin_lock_irqsave(&cmd->cmd_lock, flags);
|
||||
if (cmd->aborted) {
|
||||
if (cmd->sg_mapped)
|
||||
qlt_unmap_sg(vha, cmd);
|
||||
|
||||
spin_unlock_irqrestore(&cmd->cmd_lock, flags);
|
||||
/*
|
||||
* It's normal to see 2 calls in this path:
|
||||
|
||||
@@ -225,6 +225,9 @@ static void *ion_buffer_kmap_get(struct ion_buffer *buffer)
|
||||
void *vaddr;
|
||||
|
||||
if (buffer->kmap_cnt) {
|
||||
if (buffer->kmap_cnt == INT_MAX)
|
||||
return ERR_PTR(-EOVERFLOW);
|
||||
|
||||
buffer->kmap_cnt++;
|
||||
return buffer->vaddr;
|
||||
}
|
||||
|
||||
@@ -84,6 +84,8 @@ module_param(debug, int, 0600);
|
||||
*/
|
||||
#define MAX_MRU 1500
|
||||
#define MAX_MTU 1500
|
||||
/* SOF, ADDR, CTRL, LEN1, LEN2, ..., FCS, EOF */
|
||||
#define PROT_OVERHEAD 7
|
||||
#define GSM_NET_TX_TIMEOUT (HZ*10)
|
||||
|
||||
/**
|
||||
@@ -835,7 +837,7 @@ static int gsm_dlci_data_output(struct gsm_mux *gsm, struct gsm_dlci *dlci)
|
||||
break;
|
||||
case 2: /* Unstructed with modem bits.
|
||||
Always one byte as we never send inline break data */
|
||||
*dp++ = gsm_encode_modem(dlci);
|
||||
*dp++ = (gsm_encode_modem(dlci) << 1) | EA;
|
||||
break;
|
||||
}
|
||||
WARN_ON(kfifo_out_locked(dlci->fifo, dp , len, &dlci->lock) != len);
|
||||
@@ -1312,11 +1314,12 @@ static void gsm_control_response(struct gsm_mux *gsm, unsigned int command,
|
||||
|
||||
static void gsm_control_transmit(struct gsm_mux *gsm, struct gsm_control *ctrl)
|
||||
{
|
||||
struct gsm_msg *msg = gsm_data_alloc(gsm, 0, ctrl->len + 1, gsm->ftype);
|
||||
struct gsm_msg *msg = gsm_data_alloc(gsm, 0, ctrl->len + 2, gsm->ftype);
|
||||
if (msg == NULL)
|
||||
return;
|
||||
msg->data[0] = (ctrl->cmd << 1) | 2 | EA; /* command */
|
||||
memcpy(msg->data + 1, ctrl->data, ctrl->len);
|
||||
msg->data[0] = (ctrl->cmd << 1) | CR | EA; /* command */
|
||||
msg->data[1] = (ctrl->len << 1) | EA;
|
||||
memcpy(msg->data + 2, ctrl->data, ctrl->len);
|
||||
gsm_data_queue(gsm->dlci[0], msg);
|
||||
}
|
||||
|
||||
@@ -1339,7 +1342,6 @@ static void gsm_control_retransmit(unsigned long data)
|
||||
spin_lock_irqsave(&gsm->control_lock, flags);
|
||||
ctrl = gsm->pending_cmd;
|
||||
if (ctrl) {
|
||||
gsm->cretries--;
|
||||
if (gsm->cretries == 0) {
|
||||
gsm->pending_cmd = NULL;
|
||||
ctrl->error = -ETIMEDOUT;
|
||||
@@ -1348,6 +1350,7 @@ static void gsm_control_retransmit(unsigned long data)
|
||||
wake_up(&gsm->event);
|
||||
return;
|
||||
}
|
||||
gsm->cretries--;
|
||||
gsm_control_transmit(gsm, ctrl);
|
||||
mod_timer(&gsm->t2_timer, jiffies + gsm->t2 * HZ / 100);
|
||||
}
|
||||
@@ -1388,7 +1391,7 @@ retry:
|
||||
|
||||
/* If DLCI0 is in ADM mode skip retries, it won't respond */
|
||||
if (gsm->dlci[0]->mode == DLCI_MODE_ADM)
|
||||
gsm->cretries = 1;
|
||||
gsm->cretries = 0;
|
||||
else
|
||||
gsm->cretries = gsm->n2;
|
||||
|
||||
@@ -1822,7 +1825,6 @@ static void gsm_queue(struct gsm_mux *gsm)
|
||||
gsm_response(gsm, address, UA);
|
||||
gsm_dlci_close(dlci);
|
||||
break;
|
||||
case UA:
|
||||
case UA|PF:
|
||||
if (cr == 0 || dlci == NULL)
|
||||
break;
|
||||
@@ -1973,7 +1975,8 @@ static void gsm1_receive(struct gsm_mux *gsm, unsigned char c)
|
||||
}
|
||||
/* Any partial frame was a runt so go back to start */
|
||||
if (gsm->state != GSM_START) {
|
||||
gsm->malformed++;
|
||||
if (gsm->state != GSM_SEARCH)
|
||||
gsm->malformed++;
|
||||
gsm->state = GSM_START;
|
||||
}
|
||||
/* A SOF in GSM_START means we are still reading idling or
|
||||
@@ -2110,6 +2113,7 @@ static void gsm_cleanup_mux(struct gsm_mux *gsm)
|
||||
gsm_dlci_release(gsm->dlci[i]);
|
||||
mutex_unlock(&gsm->mutex);
|
||||
/* Now wipe the queues */
|
||||
tty_ldisc_flush(gsm->tty);
|
||||
list_for_each_entry_safe(txq, ntxq, &gsm->tx_list, list)
|
||||
kfree(txq);
|
||||
INIT_LIST_HEAD(&gsm->tx_list);
|
||||
@@ -2210,7 +2214,7 @@ static struct gsm_mux *gsm_alloc_mux(void)
|
||||
kfree(gsm);
|
||||
return NULL;
|
||||
}
|
||||
gsm->txframe = kmalloc(2 * MAX_MRU + 2, GFP_KERNEL);
|
||||
gsm->txframe = kmalloc(2 * (MAX_MTU + PROT_OVERHEAD - 1), GFP_KERNEL);
|
||||
if (gsm->txframe == NULL) {
|
||||
kfree(gsm->buf);
|
||||
kfree(gsm);
|
||||
@@ -2527,7 +2531,7 @@ static int gsmld_config(struct tty_struct *tty, struct gsm_mux *gsm,
|
||||
/* Check the MRU/MTU range looks sane */
|
||||
if (c->mru > MAX_MRU || c->mtu > MAX_MTU || c->mru < 8 || c->mtu < 8)
|
||||
return -EINVAL;
|
||||
if (c->n2 < 3)
|
||||
if (c->n2 > 255)
|
||||
return -EINVAL;
|
||||
if (c->encapsulation > 1) /* Basic, advanced, no I */
|
||||
return -EINVAL;
|
||||
@@ -2870,19 +2874,17 @@ static struct tty_ldisc_ops tty_ldisc_packet = {
|
||||
|
||||
static int gsmtty_modem_update(struct gsm_dlci *dlci, u8 brk)
|
||||
{
|
||||
u8 modembits[5];
|
||||
u8 modembits[3];
|
||||
struct gsm_control *ctrl;
|
||||
int len = 2;
|
||||
|
||||
if (brk)
|
||||
modembits[0] = (dlci->addr << 2) | 2 | EA; /* DLCI, Valid, EA */
|
||||
modembits[1] = (gsm_encode_modem(dlci) << 1) | EA;
|
||||
if (brk) {
|
||||
modembits[2] = (brk << 4) | 2 | EA; /* Length, Break, EA */
|
||||
len++;
|
||||
|
||||
modembits[0] = len << 1 | EA; /* Data bytes */
|
||||
modembits[1] = dlci->addr << 2 | 3; /* DLCI, EA, 1 */
|
||||
modembits[2] = gsm_encode_modem(dlci) << 1 | EA;
|
||||
if (brk)
|
||||
modembits[3] = brk << 4 | 2 | EA; /* Valid, EA */
|
||||
ctrl = gsm_control_send(dlci->gsm, CMD_MSC, modembits, len + 1);
|
||||
}
|
||||
ctrl = gsm_control_send(dlci->gsm, CMD_MSC, modembits, len);
|
||||
if (ctrl == NULL)
|
||||
return -ENOMEM;
|
||||
return gsm_control_wait(dlci->gsm, ctrl);
|
||||
|
||||
@@ -2668,7 +2668,7 @@ enum pci_board_num_t {
|
||||
pbn_panacom2,
|
||||
pbn_panacom4,
|
||||
pbn_plx_romulus,
|
||||
pbn_endrun_2_4000000,
|
||||
pbn_endrun_2_3906250,
|
||||
pbn_oxsemi,
|
||||
pbn_oxsemi_1_4000000,
|
||||
pbn_oxsemi_2_4000000,
|
||||
@@ -3184,10 +3184,10 @@ static struct pciserial_board pci_boards[] = {
|
||||
* signal now many ports are available
|
||||
* 2 port 952 Uart support
|
||||
*/
|
||||
[pbn_endrun_2_4000000] = {
|
||||
[pbn_endrun_2_3906250] = {
|
||||
.flags = FL_BASE0,
|
||||
.num_ports = 2,
|
||||
.base_baud = 4000000,
|
||||
.base_baud = 3906250,
|
||||
.uart_offset = 0x200,
|
||||
.first_offset = 0x1000,
|
||||
},
|
||||
@@ -4039,7 +4039,7 @@ static const struct pci_device_id serial_pci_tbl[] = {
|
||||
*/
|
||||
{ PCI_VENDOR_ID_ENDRUN, PCI_DEVICE_ID_ENDRUN_1588,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0,
|
||||
pbn_endrun_2_4000000 },
|
||||
pbn_endrun_2_3906250 },
|
||||
/*
|
||||
* Quatech cards. These actually have configurable clocks but for
|
||||
* now we just use the default.
|
||||
|
||||
@@ -3240,7 +3240,7 @@ static void serial8250_console_restore(struct uart_8250_port *up)
|
||||
|
||||
serial8250_set_divisor(port, baud, quot, frac);
|
||||
serial_port_out(port, UART_LCR, up->lcr);
|
||||
serial8250_out_MCR(up, UART_MCR_DTR | UART_MCR_RTS);
|
||||
serial8250_out_MCR(up, up->mcr | UART_MCR_DTR | UART_MCR_RTS);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user