Merge 4.19.307 into android-4.19-stable
Changes in 4.19.307
PCI: mediatek: Clear interrupt status before dispatching handler
include/linux/units.h: add helpers for kelvin to/from Celsius conversion
units: Add Watt units
units: change from 'L' to 'UL'
units: add the HZ macros
serial: sc16is7xx: set safe default SPI clock frequency
driver core: add device probe log helper
spi: introduce SPI_MODE_X_MASK macro
serial: sc16is7xx: add check for unsupported SPI modes during probe
ext4: allow for the last group to be marked as trimmed
crypto: api - Disallow identical driver names
PM: hibernate: Enforce ordering during image compression/decompression
hwrng: core - Fix page fault dead lock on mmap-ed hwrng
rpmsg: virtio: Free driver_override when rpmsg_remove()
parisc/firmware: Fix F-extend for PDC addresses
nouveau/vmm: don't set addr on the fail path to avoid warning
block: Remove special-casing of compound pages
powerpc: Use always instead of always-y in for crtsavres.o
x86/CPU/AMD: Fix disabling XSAVES on AMD family 0x17 due to erratum
driver core: Annotate dev_err_probe() with __must_check
Revert "driver core: Annotate dev_err_probe() with __must_check"
driver code: print symbolic error code
drivers: core: fix kernel-doc markup for dev_err_probe()
net/smc: fix illegal rmb_desc access in SMC-D connection dump
vlan: skip nested type that is not IFLA_VLAN_QOS_MAPPING
llc: make llc_ui_sendmsg() more robust against bonding changes
llc: Drop support for ETH_P_TR_802_2.
net/rds: Fix UBSAN: array-index-out-of-bounds in rds_cmsg_recv
tracing: Ensure visibility when inserting an element into tracing_map
tcp: Add memory barrier to tcp_push()
netlink: fix potential sleeping issue in mqueue_flush_file
net/mlx5: Use kfree(ft->g) in arfs_create_groups()
net/mlx5e: fix a double-free in arfs_create_groups
netfilter: nf_tables: restrict anonymous set and map names to 16 bytes
fjes: fix memleaks in fjes_hw_setup
net: fec: fix the unhandled context fault from smmu
btrfs: don't warn if discard range is not aligned to sector
btrfs: defrag: reject unknown flags of btrfs_ioctl_defrag_range_args
netfilter: nf_tables: reject QUEUE/DROP verdict parameters
gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04
drm: Don't unref the same fb many times by mistake due to deadlock handling
drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking
drm/bridge: nxp-ptn3460: simplify some error checking
drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
gpio: eic-sprd: Clear interrupt after set the interrupt type
mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan
tick/sched: Preserve number of idle sleeps across CPU hotplug events
x86/entry/ia32: Ensure s32 is sign extended to s64
net/sched: cbs: Fix not adding cbs instance to list
powerpc/mm: Fix null-pointer dereference in pgtable_cache_add
powerpc: Fix build error due to is_valid_bugaddr()
powerpc/mm: Fix build failures due to arch_reserved_kernel_pages()
powerpc/lib: Validate size for vector operations
audit: Send netlink ACK before setting connection in auditd_set
ACPI: video: Add quirk for the Colorful X15 AT 23 Laptop
PNP: ACPI: fix fortify warning
ACPI: extlog: fix NULL pointer dereference check
FS:JFS:UBSAN:array-index-out-of-bounds in dbAdjTree
UBSAN: array-index-out-of-bounds in dtSplitRoot
jfs: fix slab-out-of-bounds Read in dtSearch
jfs: fix array-index-out-of-bounds in dbAdjTree
jfs: fix uaf in jfs_evict_inode
pstore/ram: Fix crash when setting number of cpus to an odd number
crypto: stm32/crc32 - fix parsing list of devices
afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*()
rxrpc_find_service_conn_rcu: fix the usage of read_seqbegin_or_lock()
jfs: fix array-index-out-of-bounds in diNewExt
s390/ptrace: handle setting of fpc register correctly
KVM: s390: fix setting of fpc register
SUNRPC: Fix a suspicious RCU usage warning
ext4: fix inconsistent between segment fstrim and full fstrim
ext4: unify the type of flexbg_size to unsigned int
ext4: remove unnecessary check from alloc_flex_gd()
ext4: avoid online resizing failures due to oversized flex bg
scsi: lpfc: Fix possible file string name overflow when updating firmware
PCI: Add no PM reset quirk for NVIDIA Spectrum devices
bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk
ARM: dts: imx7s: Fix lcdif compatible
ARM: dts: imx7s: Fix nand-controller #size-cells
wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus()
bpf: Add map and need_defer parameters to .map_fd_put_ptr()
scsi: libfc: Don't schedule abort twice
scsi: libfc: Fix up timeout error in fc_fcp_rec_error()
ARM: dts: rockchip: fix rk3036 hdmi ports node
ARM: dts: imx25/27-eukrea: Fix RTC node name
ARM: dts: imx: Use flash@0,0 pattern
ARM: dts: imx27: Fix sram node
ARM: dts: imx1: Fix sram node
ARM: dts: imx27-apf27dev: Fix LED name
ARM: dts: imx23-sansa: Use preferred i2c-gpios properties
ARM: dts: imx23/28: Fix the DMA controller node name
md: Whenassemble the array, consult the superblock of the freshest device
wifi: rtl8xxxu: Add additional USB IDs for RTL8192EU devices
wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift()
wifi: cfg80211: free beacon_ies when overridden from hidden BSS
f2fs: fix to check return value of f2fs_reserve_new_block()
ASoC: doc: Fix undefined SND_SOC_DAPM_NOPM argument
fast_dput(): handle underflows gracefully
RDMA/IPoIB: Fix error code return in ipoib_mcast_join
drm/drm_file: fix use of uninitialized variable
drm/framebuffer: Fix use of uninitialized variable
drm/mipi-dsi: Fix detach call without attach
media: stk1160: Fixed high volume of stk1160_dbg messages
media: rockchip: rga: fix swizzling for RGB formats
PCI: add INTEL_HDA_ARL to pci_ids.h
ALSA: hda: Intel: add HDA_ARL PCI ID support
drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time
IB/ipoib: Fix mcast list locking
media: ddbridge: fix an error code problem in ddb_probe
drm/msm/dpu: Ratelimit framedone timeout msgs
clk: hi3620: Fix memory leak in hi3620_mmc_clk_init()
clk: mmp: pxa168: Fix memory leak in pxa168_clk_init()
drm/amdgpu: Let KFD sync with VM fences
drm/amdgpu: Drop 'fence' check in 'to_amdgpu_amdkfd_fence()'
leds: trigger: panic: Don't register panic notifier if creating the trigger failed
um: Fix naming clash between UML and scheduler
um: Don't use vfprintf() for os_info()
um: net: Fix return type of uml_net_start_xmit()
mfd: ti_am335x_tscadc: Fix TI SoC dependencies
PCI: Only override AMD USB controller if required
usb: hub: Replace hardcoded quirk value with BIT() macro
libsubcmd: Fix memory leak in uniq()
virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings
blk-mq: fix IO hang from sbitmap wakeup race
ceph: fix deadlock or deadcode of misusing dget()
drm/amdgpu: Release 'adev->pm.fw' before return in 'amdgpu_device_need_post()'
wifi: cfg80211: fix RCU dereference in __cfg80211_bss_update
scsi: isci: Fix an error code problem in isci_io_request_build()
net: remove unneeded break
ixgbe: Remove non-inclusive language
ixgbe: Refactor returning internal error codes
ixgbe: Refactor overtemp event handling
ixgbe: Fix an error handling path in ixgbe_read_iosf_sb_reg_x550()
ipv6: Ensure natural alignment of const ipv6 loopback and router addresses
llc: call sock_orphan() at release time
netfilter: nf_log: replace BUG_ON by WARN_ON_ONCE when putting logger
net: ipv4: fix a memleak in ip_setup_cork
af_unix: fix lockdep positive in sk_diag_dump_icons()
net: sysfs: Fix /sys/class/net/<iface> path
HID: apple: Add support for the 2021 Magic Keyboard
HID: apple: Swap the Fn and Left Control keys on Apple keyboards
HID: apple: Add 2021 magic keyboard FN key mapping
bonding: remove print in bond_verify_device_path
dmaengine: fix is_slave_direction() return false when DMA_DEV_TO_DEV
phy: ti: phy-omap-usb2: Fix NULL pointer dereference for SRP
atm: idt77252: fix a memleak in open_card_ubr0
hwmon: (aspeed-pwm-tacho) mutex for tach reading
hwmon: (coretemp) Fix out-of-bounds memory access
hwmon: (coretemp) Fix bogus core_id to attr name mapping
inet: read sk->sk_family once in inet_recv_error()
rxrpc: Fix response to PING RESPONSE ACKs to a dead call
tipc: Check the bearer type before calling tipc_udp_nl_bearer_add()
ppp_async: limit MRU to 64K
netfilter: nft_compat: reject unused compat flag
netfilter: nft_compat: restrict match/target protocol to u16
net/af_iucv: clean up a try_then_request_module()
USB: serial: qcserial: add new usb-id for Dell Wireless DW5826e
USB: serial: option: add Fibocom FM101-GL variant
USB: serial: cp210x: add ID for IMST iM871A-USB
Input: atkbd - skip ATKBD_CMD_SETLEDS when skipping ATKBD_CMD_GETID
vhost: use kzalloc() instead of kmalloc() followed by memset()
hrtimer: Report offline hrtimer enqueue
btrfs: forbid creating subvol qgroups
btrfs: send: return EOPNOTSUPP on unknown flags
spi: ppc4xx: Drop write-only variable
ASoC: rt5645: Fix deadlock in rt5645_jack_detect_work()
Documentation: net-sysfs: describe missing statistics
net: sysfs: Fix /sys/class/net/<iface> path for statistics
MIPS: Add 'memory' clobber to csum_ipv6_magic() inline assembler
i40e: Fix waiting for queues of all VSIs to be disabled
tracing/trigger: Fix to return error if failed to alloc snapshot
mm/writeback: fix possible divide-by-zero in wb_dirty_limits(), again
HID: wacom: generic: Avoid reporting a serial of '0' to userspace
HID: wacom: Do not register input devices until after hid_hw_start
USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT
usb: f_mass_storage: forbid async queue when shutdown happen
scsi: Revert "scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock"
firewire: core: correct documentation of fw_csr_string() kernel API
nfc: nci: free rx_data_reassembly skb on NCI device cleanup
xen-netback: properly sync TX responses
binder: signal epoll threads of self-work
ext4: fix double-free of blocks due to wrong extents moved_len
staging: iio: ad5933: fix type mismatch regression
ring-buffer: Clean ring_buffer_poll_wait() error return
serial: max310x: set default value when reading clock ready bit
serial: max310x: improve crystal stable clock detection
x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6
x86/mm/ident_map: Use gbpages only where full GB page should be mapped.
ALSA: hda/conexant: Add quirk for SWS JS201D
nilfs2: fix data corruption in dsync block recovery for small block sizes
nilfs2: fix hang in nilfs_lookup_dirty_data_buffers()
nfp: use correct macro for LengthSelect in BAR config
irqchip/irq-brcmstb-l2: Add write memory barrier before exit
pmdomain: core: Move the unused cleanup to a _sync initcall
Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"
sched/membarrier: reduce the ability to hammer on sys_membarrier
nilfs2: fix potential bug in end_buffer_async_write
lsm: new security_file_ioctl_compat() hook
netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval()
Linux 4.19.307
Change-Id: Ib05aec445afe9920e2502bcfce1c52db76e27139
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
What: /sys/class/<iface>/queues/rx-<queue>/rps_cpus
|
||||
What: /sys/class/net/<iface>/queues/rx-<queue>/rps_cpus
|
||||
Date: March 2010
|
||||
KernelVersion: 2.6.35
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -8,7 +8,7 @@ Description:
|
||||
network device queue. Possible values depend on the number
|
||||
of available CPU(s) in the system.
|
||||
|
||||
What: /sys/class/<iface>/queues/rx-<queue>/rps_flow_cnt
|
||||
What: /sys/class/net/<iface>/queues/rx-<queue>/rps_flow_cnt
|
||||
Date: April 2010
|
||||
KernelVersion: 2.6.35
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -16,7 +16,7 @@ Description:
|
||||
Number of Receive Packet Steering flows being currently
|
||||
processed by this particular network device receive queue.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/tx_timeout
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/tx_timeout
|
||||
Date: November 2011
|
||||
KernelVersion: 3.3
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -24,7 +24,7 @@ Description:
|
||||
Indicates the number of transmit timeout events seen by this
|
||||
network interface transmit queue.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/tx_maxrate
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/tx_maxrate
|
||||
Date: March 2015
|
||||
KernelVersion: 4.1
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -32,7 +32,7 @@ Description:
|
||||
A Mbps max-rate set for the queue, a value of zero means disabled,
|
||||
default is disabled.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/xps_cpus
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/xps_cpus
|
||||
Date: November 2010
|
||||
KernelVersion: 2.6.38
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -42,7 +42,7 @@ Description:
|
||||
network device transmit queue. Possible vaules depend on the
|
||||
number of available CPU(s) in the system.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/xps_rxqs
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/xps_rxqs
|
||||
Date: June 2018
|
||||
KernelVersion: 4.18.0
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -53,7 +53,7 @@ Description:
|
||||
number of available receive queue(s) in the network device.
|
||||
Default is disabled.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/hold_time
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/hold_time
|
||||
Date: November 2011
|
||||
KernelVersion: 3.3
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -62,7 +62,7 @@ Description:
|
||||
of this particular network device transmit queue.
|
||||
Default value is 1000.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/inflight
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/inflight
|
||||
Date: November 2011
|
||||
KernelVersion: 3.3
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -70,7 +70,7 @@ Description:
|
||||
Indicates the number of bytes (objects) in flight on this
|
||||
network device transmit queue.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit
|
||||
Date: November 2011
|
||||
KernelVersion: 3.3
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -79,7 +79,7 @@ Description:
|
||||
on this network device transmit queue. This value is clamped
|
||||
to be within the bounds defined by limit_max and limit_min.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit_max
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit_max
|
||||
Date: November 2011
|
||||
KernelVersion: 3.3
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -88,7 +88,7 @@ Description:
|
||||
queued on this network device transmit queue. See
|
||||
include/linux/dynamic_queue_limits.h for the default value.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit_min
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit_min
|
||||
Date: November 2011
|
||||
KernelVersion: 3.3
|
||||
Contact: netdev@vger.kernel.org
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
What: /sys/class/<iface>/statistics/collisions
|
||||
What: /sys/class/net/<iface>/statistics/collisions
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -6,7 +6,7 @@ Description:
|
||||
Indicates the number of collisions seen by this network device.
|
||||
This value might not be relevant with all MAC layers.
|
||||
|
||||
What: /sys/class/<iface>/statistics/multicast
|
||||
What: /sys/class/net/<iface>/statistics/multicast
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -14,7 +14,7 @@ Description:
|
||||
Indicates the number of multicast packets received by this
|
||||
network device.
|
||||
|
||||
What: /sys/class/<iface>/statistics/rx_bytes
|
||||
What: /sys/class/net/<iface>/statistics/rx_bytes
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -23,7 +23,7 @@ Description:
|
||||
See the network driver for the exact meaning of when this
|
||||
value is incremented.
|
||||
|
||||
What: /sys/class/<iface>/statistics/rx_compressed
|
||||
What: /sys/class/net/<iface>/statistics/rx_compressed
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -32,7 +32,7 @@ Description:
|
||||
network device. This value might only be relevant for interfaces
|
||||
that support packet compression (e.g: PPP).
|
||||
|
||||
What: /sys/class/<iface>/statistics/rx_crc_errors
|
||||
What: /sys/class/net/<iface>/statistics/rx_crc_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -41,7 +41,7 @@ Description:
|
||||
by this network device. Note that the specific meaning might
|
||||
depend on the MAC layer used by the interface.
|
||||
|
||||
What: /sys/class/<iface>/statistics/rx_dropped
|
||||
What: /sys/class/net/<iface>/statistics/rx_dropped
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -51,7 +51,15 @@ Description:
|
||||
packet processing. See the network driver for the exact
|
||||
meaning of this value.
|
||||
|
||||
What: /sys/class/<iface>/statistics/rx_fifo_errors
|
||||
What: /sys/class/net/<iface>/statistics/rx_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
Description:
|
||||
Indicates the number of receive errors on this network device.
|
||||
See the network driver for the exact meaning of this value.
|
||||
|
||||
What: /sys/class/net/<iface>/statistics/rx_fifo_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -60,7 +68,7 @@ Description:
|
||||
network device. See the network driver for the exact
|
||||
meaning of this value.
|
||||
|
||||
What: /sys/class/<iface>/statistics/rx_frame_errors
|
||||
What: /sys/class/net/<iface>/statistics/rx_frame_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -70,7 +78,7 @@ Description:
|
||||
on the MAC layer protocol used. See the network driver for
|
||||
the exact meaning of this value.
|
||||
|
||||
What: /sys/class/<iface>/statistics/rx_length_errors
|
||||
What: /sys/class/net/<iface>/statistics/rx_length_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -79,7 +87,7 @@ Description:
|
||||
error, oversized or undersized. See the network driver for the
|
||||
exact meaning of this value.
|
||||
|
||||
What: /sys/class/<iface>/statistics/rx_missed_errors
|
||||
What: /sys/class/net/<iface>/statistics/rx_missed_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -88,7 +96,15 @@ Description:
|
||||
due to lack of capacity in the receive side. See the network
|
||||
driver for the exact meaning of this value.
|
||||
|
||||
What: /sys/class/<iface>/statistics/rx_over_errors
|
||||
What: /sys/class/net/<iface>/statistics/rx_nohandler
|
||||
Date: February 2016
|
||||
KernelVersion: 4.6
|
||||
Contact: netdev@vger.kernel.org
|
||||
Description:
|
||||
Indicates the number of received packets that were dropped on
|
||||
an inactive device by the network core.
|
||||
|
||||
What: /sys/class/net/<iface>/statistics/rx_over_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -98,7 +114,7 @@ Description:
|
||||
(e.g: larger than MTU). See the network driver for the exact
|
||||
meaning of this value.
|
||||
|
||||
What: /sys/class/<iface>/statistics/rx_packets
|
||||
What: /sys/class/net/<iface>/statistics/rx_packets
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -106,7 +122,7 @@ Description:
|
||||
Indicates the total number of good packets received by this
|
||||
network device.
|
||||
|
||||
What: /sys/class/<iface>/statistics/tx_aborted_errors
|
||||
What: /sys/class/net/<iface>/statistics/tx_aborted_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -116,7 +132,7 @@ Description:
|
||||
a medium collision). See the network driver for the exact
|
||||
meaning of this value.
|
||||
|
||||
What: /sys/class/<iface>/statistics/tx_bytes
|
||||
What: /sys/class/net/<iface>/statistics/tx_bytes
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -127,7 +143,7 @@ Description:
|
||||
transmitted packets or all packets that have been queued for
|
||||
transmission.
|
||||
|
||||
What: /sys/class/<iface>/statistics/tx_carrier_errors
|
||||
What: /sys/class/net/<iface>/statistics/tx_carrier_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -136,7 +152,7 @@ Description:
|
||||
because of carrier errors (e.g: physical link down). See the
|
||||
network driver for the exact meaning of this value.
|
||||
|
||||
What: /sys/class/<iface>/statistics/tx_compressed
|
||||
What: /sys/class/net/<iface>/statistics/tx_compressed
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -145,7 +161,7 @@ Description:
|
||||
this might only be relevant for devices that support
|
||||
compression (e.g: PPP).
|
||||
|
||||
What: /sys/class/<iface>/statistics/tx_dropped
|
||||
What: /sys/class/net/<iface>/statistics/tx_dropped
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -154,7 +170,7 @@ Description:
|
||||
See the driver for the exact reasons as to why the packets were
|
||||
dropped.
|
||||
|
||||
What: /sys/class/<iface>/statistics/tx_errors
|
||||
What: /sys/class/net/<iface>/statistics/tx_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -163,7 +179,7 @@ Description:
|
||||
a network device. See the driver for the exact reasons as to
|
||||
why the packets were dropped.
|
||||
|
||||
What: /sys/class/<iface>/statistics/tx_fifo_errors
|
||||
What: /sys/class/net/<iface>/statistics/tx_fifo_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -172,7 +188,7 @@ Description:
|
||||
FIFO error. See the driver for the exact reasons as to why the
|
||||
packets were dropped.
|
||||
|
||||
What: /sys/class/<iface>/statistics/tx_heartbeat_errors
|
||||
What: /sys/class/net/<iface>/statistics/tx_heartbeat_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -181,7 +197,7 @@ Description:
|
||||
reported as heartbeat errors. See the driver for the exact
|
||||
reasons as to why the packets were dropped.
|
||||
|
||||
What: /sys/class/<iface>/statistics/tx_packets
|
||||
What: /sys/class/net/<iface>/statistics/tx_packets
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -190,7 +206,7 @@ Description:
|
||||
device. See the driver for whether this reports the number of all
|
||||
attempted or successful transmissions.
|
||||
|
||||
What: /sys/class/<iface>/statistics/tx_window_errors
|
||||
What: /sys/class/net/<iface>/statistics/tx_window_errors
|
||||
Date: April 2005
|
||||
KernelVersion: 2.6.12
|
||||
Contact: netdev@vger.kernel.org
|
||||
|
||||
@@ -234,7 +234,7 @@ corresponding soft power control. In this case it is necessary to create
|
||||
a virtual widget - a widget with no control bits e.g.
|
||||
::
|
||||
|
||||
SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_DAPM_NOPM, 0, 0, NULL, 0),
|
||||
SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
|
||||
|
||||
This can be used to merge to signal paths together in software.
|
||||
|
||||
|
||||
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 19
|
||||
SUBLEVEL = 306
|
||||
SUBLEVEL = 307
|
||||
EXTRAVERSION =
|
||||
NAME = "People's Front"
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
pinctrl-0 = <&pinctrl_weim>;
|
||||
status = "okay";
|
||||
|
||||
nor: nor@0,0 {
|
||||
nor: flash@0,0 {
|
||||
compatible = "cfi-flash";
|
||||
reg = <0 0x00000000 0x02000000>;
|
||||
bank-width = <4>;
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
pinctrl-0 = <&pinctrl_weim>;
|
||||
status = "okay";
|
||||
|
||||
nor: nor@0,0 {
|
||||
nor: flash@0,0 {
|
||||
compatible = "cfi-flash";
|
||||
reg = <0 0x00000000 0x02000000>;
|
||||
bank-width = <2>;
|
||||
|
||||
@@ -268,9 +268,12 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
esram: esram@300000 {
|
||||
esram: sram@300000 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0x00300000 0x20000>;
|
||||
ranges = <0 0x00300000 0x20000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -175,10 +175,8 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "i2c-gpio";
|
||||
gpios = <
|
||||
&gpio1 24 0 /* SDA */
|
||||
&gpio1 22 0 /* SCL */
|
||||
>;
|
||||
sda-gpios = <&gpio1 24 0>;
|
||||
scl-gpios = <&gpio1 22 0>;
|
||||
i2c-gpio,delay-us = <2>; /* ~100 kHz */
|
||||
};
|
||||
|
||||
@@ -186,10 +184,8 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "i2c-gpio";
|
||||
gpios = <
|
||||
&gpio0 31 0 /* SDA */
|
||||
&gpio0 30 0 /* SCL */
|
||||
>;
|
||||
sda-gpios = <&gpio0 31 0>;
|
||||
scl-gpios = <&gpio0 30 0>;
|
||||
i2c-gpio,delay-us = <2>; /* ~100 kHz */
|
||||
|
||||
touch: touch@20 {
|
||||
|
||||
@@ -406,7 +406,7 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
dma_apbx: dma-apbx@80024000 {
|
||||
dma_apbx: dma-controller@80024000 {
|
||||
compatible = "fsl,imx23-dma-apbx";
|
||||
reg = <0x80024000 0x2000>;
|
||||
interrupts = <7 5 9 26
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
pinctrl-0 = <&pinctrl_i2c1>;
|
||||
status = "okay";
|
||||
|
||||
pcf8563@51 {
|
||||
rtc@51 {
|
||||
compatible = "nxp,pcf8563";
|
||||
reg = <0x51>;
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_gpio_leds>;
|
||||
|
||||
user {
|
||||
led-user {
|
||||
label = "Heartbeat";
|
||||
gpios = <&gpio6 14 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "heartbeat";
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
pinctrl-0 = <&pinctrl_i2c1>;
|
||||
status = "okay";
|
||||
|
||||
pcf8563@51 {
|
||||
rtc@51 {
|
||||
compatible = "nxp,pcf8563";
|
||||
reg = <0x51>;
|
||||
};
|
||||
@@ -96,7 +96,7 @@
|
||||
&weim {
|
||||
status = "okay";
|
||||
|
||||
nor: nor@0,0 {
|
||||
nor: flash@0,0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "cfi-flash";
|
||||
|
||||
@@ -328,7 +328,7 @@
|
||||
&weim {
|
||||
status = "okay";
|
||||
|
||||
nor: nor@0,0 {
|
||||
nor: flash@0,0 {
|
||||
compatible = "cfi-flash";
|
||||
reg = <0 0x00000000 0x02000000>;
|
||||
bank-width = <2>;
|
||||
|
||||
@@ -588,6 +588,9 @@
|
||||
iram: iram@ffff4c00 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0xffff4c00 0xb400>;
|
||||
ranges = <0 0xffff4c00 0xb400>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -984,7 +984,7 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
dma_apbx: dma-apbx@80024000 {
|
||||
dma_apbx: dma-controller@80024000 {
|
||||
compatible = "fsl,imx28-dma-apbx";
|
||||
reg = <0x80024000 0x2000>;
|
||||
interrupts = <78 79 66 0
|
||||
|
||||
@@ -701,7 +701,7 @@
|
||||
};
|
||||
|
||||
lcdif: lcdif@30730000 {
|
||||
compatible = "fsl,imx7d-lcdif", "fsl,imx28-lcdif";
|
||||
compatible = "fsl,imx7d-lcdif", "fsl,imx6sx-lcdif";
|
||||
reg = <0x30730000 0x10000>;
|
||||
interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clks IMX7D_LCDIF_PIXEL_ROOT_CLK>,
|
||||
@@ -1094,7 +1094,7 @@
|
||||
gpmi: gpmi-nand@33002000{
|
||||
compatible = "fsl,imx7d-gpmi-nand";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <0x33002000 0x2000>, <0x33004000 0x4000>;
|
||||
reg-names = "gpmi-nand", "bch";
|
||||
interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
@@ -336,12 +336,20 @@
|
||||
pinctrl-0 = <&hdmi_ctl>;
|
||||
status = "disabled";
|
||||
|
||||
hdmi_in: port {
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
hdmi_in_vop: endpoint@0 {
|
||||
|
||||
hdmi_in: port@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&vop_out_hdmi>;
|
||||
|
||||
hdmi_in_vop: endpoint {
|
||||
remote-endpoint = <&vop_out_hdmi>;
|
||||
};
|
||||
};
|
||||
|
||||
hdmi_out: port@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -276,7 +276,8 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
" .set pop"
|
||||
: "=&r" (sum), "=&r" (tmp)
|
||||
: "r" (saddr), "r" (daddr),
|
||||
"0" (htonl(len)), "r" (htonl(proto)), "r" (sum));
|
||||
"0" (htonl(len)), "r" (htonl(proto)), "r" (sum)
|
||||
: "memory");
|
||||
|
||||
return csum_fold(sum);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <asm/cpu-features.h>
|
||||
#include <asm/cpu-info.h>
|
||||
#include <asm/fpu.h>
|
||||
|
||||
/* Whether to accept legacy-NaN and 2008-NaN user binaries. */
|
||||
bool mips_use_nan_legacy;
|
||||
@@ -311,6 +312,11 @@ void mips_set_personality_nan(struct arch_elf_state *state)
|
||||
struct cpuinfo_mips *c = &boot_cpu_data;
|
||||
struct task_struct *t = current;
|
||||
|
||||
/* Do this early so t->thread.fpu.fcr31 won't be clobbered in case
|
||||
* we are preempted before the lose_fpu(0) in start_thread.
|
||||
*/
|
||||
lose_fpu(0);
|
||||
|
||||
t->thread.fpu.fcr31 = c->fpu_csr31;
|
||||
switch (state->nan_2008) {
|
||||
case 0:
|
||||
|
||||
@@ -330,5 +330,9 @@ static inline void mmu_early_init_devtree(void) { }
|
||||
#include <asm/nohash/mmu.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_FA_DUMP) || defined(CONFIG_PRESERVE_FA_DUMP)
|
||||
#define __HAVE_ARCH_RESERVED_KERNEL_PAGES
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _ASM_POWERPC_MMU_H_ */
|
||||
|
||||
@@ -42,9 +42,6 @@ u64 memory_hotplug_max(void);
|
||||
#else
|
||||
#define memory_hotplug_max() memblock_end_of_DRAM()
|
||||
#endif /* CONFIG_NEED_MULTIPLE_NODES */
|
||||
#ifdef CONFIG_FA_DUMP
|
||||
#define __HAVE_ARCH_RESERVED_KERNEL_PAGES
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _ASM_MMZONE_H_ */
|
||||
|
||||
@@ -1341,10 +1341,12 @@ static int emulate_instruction(struct pt_regs *regs)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GENERIC_BUG
|
||||
int is_valid_bugaddr(unsigned long addr)
|
||||
{
|
||||
return is_kernel_addr(addr);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MATH_EMULATION
|
||||
static int emulate_math(struct pt_regs *regs)
|
||||
|
||||
@@ -473,6 +473,8 @@ static int do_fp_load(struct instruction_op *op, unsigned long ea,
|
||||
} u;
|
||||
|
||||
nb = GETSIZE(op->type);
|
||||
if (nb > sizeof(u))
|
||||
return -EINVAL;
|
||||
if (!address_ok(regs, ea, nb))
|
||||
return -EFAULT;
|
||||
rn = op->reg;
|
||||
@@ -523,6 +525,8 @@ static int do_fp_store(struct instruction_op *op, unsigned long ea,
|
||||
} u;
|
||||
|
||||
nb = GETSIZE(op->type);
|
||||
if (nb > sizeof(u))
|
||||
return -EINVAL;
|
||||
if (!address_ok(regs, ea, nb))
|
||||
return -EFAULT;
|
||||
rn = op->reg;
|
||||
@@ -567,6 +571,9 @@ static nokprobe_inline int do_vec_load(int rn, unsigned long ea,
|
||||
u8 b[sizeof(__vector128)];
|
||||
} u = {};
|
||||
|
||||
if (size > sizeof(u))
|
||||
return -EINVAL;
|
||||
|
||||
if (!address_ok(regs, ea & ~0xfUL, 16))
|
||||
return -EFAULT;
|
||||
/* align to multiple of size */
|
||||
@@ -594,6 +601,9 @@ static nokprobe_inline int do_vec_store(int rn, unsigned long ea,
|
||||
u8 b[sizeof(__vector128)];
|
||||
} u;
|
||||
|
||||
if (size > sizeof(u))
|
||||
return -EINVAL;
|
||||
|
||||
if (!address_ok(regs, ea & ~0xfUL, 16))
|
||||
return -EFAULT;
|
||||
/* align to multiple of size */
|
||||
|
||||
@@ -65,7 +65,7 @@ void pgtable_cache_add(unsigned shift, void (*ctor)(void *))
|
||||
* as to leave enough 0 bits in the address to contain it. */
|
||||
unsigned long minalign = max(MAX_PGTABLE_INDEX_SIZE + 1,
|
||||
HUGEPD_SHIFT_MASK + 1);
|
||||
struct kmem_cache *new;
|
||||
struct kmem_cache *new = NULL;
|
||||
|
||||
/* It would be nice if this was a BUILD_BUG_ON(), but at the
|
||||
* moment, gcc doesn't seem to recognize is_power_of_2 as a
|
||||
@@ -78,7 +78,8 @@ void pgtable_cache_add(unsigned shift, void (*ctor)(void *))
|
||||
|
||||
align = max_t(unsigned long, align, minalign);
|
||||
name = kasprintf(GFP_KERNEL, "pgtable-2^%d", shift);
|
||||
new = kmem_cache_create(name, table_size, align, 0, ctor);
|
||||
if (name)
|
||||
new = kmem_cache_create(name, table_size, align, 0, ctor);
|
||||
if (!new)
|
||||
panic("Could not allocate pgtable cache for order %d", shift);
|
||||
|
||||
|
||||
@@ -414,6 +414,7 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
|
||||
/*
|
||||
* floating point control reg. is in the thread structure
|
||||
*/
|
||||
save_fpu_regs();
|
||||
if ((unsigned int) data != 0 ||
|
||||
test_fp_ctl(data >> (BITS_PER_LONG - 32)))
|
||||
return -EINVAL;
|
||||
@@ -774,6 +775,7 @@ static int __poke_user_compat(struct task_struct *child,
|
||||
/*
|
||||
* floating point control reg. is in the thread structure
|
||||
*/
|
||||
save_fpu_regs();
|
||||
if (test_fp_ctl(tmp))
|
||||
return -EINVAL;
|
||||
child->thread.fpu.fpc = data;
|
||||
@@ -1002,9 +1004,7 @@ static int s390_fpregs_set(struct task_struct *target,
|
||||
int rc = 0;
|
||||
freg_t fprs[__NUM_FPRS];
|
||||
|
||||
if (target == current)
|
||||
save_fpu_regs();
|
||||
|
||||
save_fpu_regs();
|
||||
if (MACHINE_HAS_VX)
|
||||
convert_vx_to_fp(fprs, target->thread.fpu.vxrs);
|
||||
else
|
||||
|
||||
@@ -2995,10 +2995,6 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
|
||||
|
||||
vcpu_load(vcpu);
|
||||
|
||||
if (test_fp_ctl(fpu->fpc)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
vcpu->run->s.regs.fpc = fpu->fpc;
|
||||
if (MACHINE_HAS_VX)
|
||||
convert_fp_to_vx((__vector128 *) vcpu->run->s.regs.vrs,
|
||||
@@ -3006,7 +3002,6 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
|
||||
else
|
||||
memcpy(vcpu->run->s.regs.fprs, &fpu->fprs, sizeof(fpu->fprs));
|
||||
|
||||
out:
|
||||
vcpu_put(vcpu);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ static int uml_net_close(struct net_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
static netdev_tx_t uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
struct uml_net_private *lp = netdev_priv(dev);
|
||||
unsigned long flags;
|
||||
|
||||
@@ -49,7 +49,7 @@ extern void do_uml_exitcalls(void);
|
||||
* Are we disallowed to sleep? Used to choose between GFP_KERNEL and
|
||||
* GFP_ATOMIC.
|
||||
*/
|
||||
extern int __cant_sleep(void);
|
||||
extern int __uml_cant_sleep(void);
|
||||
extern int get_current_pid(void);
|
||||
extern int copy_from_user_proc(void *to, void *from, int size);
|
||||
extern int cpu(void);
|
||||
|
||||
@@ -210,7 +210,7 @@ void arch_cpu_idle(void)
|
||||
local_irq_enable();
|
||||
}
|
||||
|
||||
int __cant_sleep(void) {
|
||||
int __uml_cant_sleep(void) {
|
||||
return in_atomic() || irqs_disabled() || in_interrupt();
|
||||
/* Is in_interrupt() really needed? */
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv)
|
||||
unsigned long stack, sp;
|
||||
int pid, fds[2], ret, n;
|
||||
|
||||
stack = alloc_stack(0, __cant_sleep());
|
||||
stack = alloc_stack(0, __uml_cant_sleep());
|
||||
if (stack == 0)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -69,7 +69,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv)
|
||||
data.pre_data = pre_data;
|
||||
data.argv = argv;
|
||||
data.fd = fds[1];
|
||||
data.buf = __cant_sleep() ? uml_kmalloc(PATH_MAX, UM_GFP_ATOMIC) :
|
||||
data.buf = __uml_cant_sleep() ? uml_kmalloc(PATH_MAX, UM_GFP_ATOMIC) :
|
||||
uml_kmalloc(PATH_MAX, UM_GFP_KERNEL);
|
||||
pid = clone(helper_child, (void *) sp, CLONE_VM, &data);
|
||||
if (pid < 0) {
|
||||
@@ -116,7 +116,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
|
||||
unsigned long stack, sp;
|
||||
int pid, status, err;
|
||||
|
||||
stack = alloc_stack(0, __cant_sleep());
|
||||
stack = alloc_stack(0, __uml_cant_sleep());
|
||||
if (stack == 0)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -166,23 +166,38 @@ __uml_setup("quiet", quiet_cmd_param,
|
||||
"quiet\n"
|
||||
" Turns off information messages during boot.\n\n");
|
||||
|
||||
/*
|
||||
* The os_info/os_warn functions will be called by helper threads. These
|
||||
* have a very limited stack size and using the libc formatting functions
|
||||
* may overflow the stack.
|
||||
* So pull in the kernel vscnprintf and use that instead with a fixed
|
||||
* on-stack buffer.
|
||||
*/
|
||||
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
|
||||
|
||||
void os_info(const char *fmt, ...)
|
||||
{
|
||||
char buf[256];
|
||||
va_list list;
|
||||
int len;
|
||||
|
||||
if (quiet_info)
|
||||
return;
|
||||
|
||||
va_start(list, fmt);
|
||||
vfprintf(stderr, fmt, list);
|
||||
len = vscnprintf(buf, sizeof(buf), fmt, list);
|
||||
fwrite(buf, len, 1, stderr);
|
||||
va_end(list);
|
||||
}
|
||||
|
||||
void os_warn(const char *fmt, ...)
|
||||
{
|
||||
char buf[256];
|
||||
va_list list;
|
||||
int len;
|
||||
|
||||
va_start(list, fmt);
|
||||
vfprintf(stderr, fmt, list);
|
||||
len = vscnprintf(buf, sizeof(buf), fmt, list);
|
||||
fwrite(buf, len, 1, stderr);
|
||||
va_end(list);
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ config X86_CMOV
|
||||
config X86_MINIMUM_CPU_FAMILY
|
||||
int
|
||||
default "64" if X86_64
|
||||
default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || MCORE2 || MK7 || MK8)
|
||||
default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCORE2 || MK7 || MK8)
|
||||
default "5" if X86_32 && X86_CMPXCHG64
|
||||
default "4"
|
||||
|
||||
|
||||
@@ -14,12 +14,29 @@ struct pt_regs;
|
||||
,,regs->di,,regs->si,,regs->dx \
|
||||
,,regs->r10,,regs->r8,,regs->r9) \
|
||||
|
||||
|
||||
/* SYSCALL_PT_ARGS is Adapted from s390x */
|
||||
#define SYSCALL_PT_ARG6(m, t1, t2, t3, t4, t5, t6) \
|
||||
SYSCALL_PT_ARG5(m, t1, t2, t3, t4, t5), m(t6, (regs->bp))
|
||||
#define SYSCALL_PT_ARG5(m, t1, t2, t3, t4, t5) \
|
||||
SYSCALL_PT_ARG4(m, t1, t2, t3, t4), m(t5, (regs->di))
|
||||
#define SYSCALL_PT_ARG4(m, t1, t2, t3, t4) \
|
||||
SYSCALL_PT_ARG3(m, t1, t2, t3), m(t4, (regs->si))
|
||||
#define SYSCALL_PT_ARG3(m, t1, t2, t3) \
|
||||
SYSCALL_PT_ARG2(m, t1, t2), m(t3, (regs->dx))
|
||||
#define SYSCALL_PT_ARG2(m, t1, t2) \
|
||||
SYSCALL_PT_ARG1(m, t1), m(t2, (regs->cx))
|
||||
#define SYSCALL_PT_ARG1(m, t1) m(t1, (regs->bx))
|
||||
#define SYSCALL_PT_ARGS(x, ...) SYSCALL_PT_ARG##x(__VA_ARGS__)
|
||||
|
||||
#define __SC_COMPAT_CAST(t, a) \
|
||||
(__typeof(__builtin_choose_expr(__TYPE_IS_L(t), 0, 0U))) \
|
||||
(unsigned int)a
|
||||
|
||||
/* Mapping of registers to parameters for syscalls on i386 */
|
||||
#define SC_IA32_REGS_TO_ARGS(x, ...) \
|
||||
__MAP(x,__SC_ARGS \
|
||||
,,(unsigned int)regs->bx,,(unsigned int)regs->cx \
|
||||
,,(unsigned int)regs->dx,,(unsigned int)regs->si \
|
||||
,,(unsigned int)regs->di,,(unsigned int)regs->bp)
|
||||
SYSCALL_PT_ARGS(x, __SC_COMPAT_CAST, \
|
||||
__MAP(x, __SC_TYPE, __VA_ARGS__)) \
|
||||
|
||||
#ifdef CONFIG_IA32_EMULATION
|
||||
/*
|
||||
|
||||
@@ -26,18 +26,31 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
|
||||
for (; addr < end; addr = next) {
|
||||
pud_t *pud = pud_page + pud_index(addr);
|
||||
pmd_t *pmd;
|
||||
bool use_gbpage;
|
||||
|
||||
next = (addr & PUD_MASK) + PUD_SIZE;
|
||||
if (next > end)
|
||||
next = end;
|
||||
|
||||
if (info->direct_gbpages) {
|
||||
/* if this is already a gbpage, this portion is already mapped */
|
||||
if (pud_large(*pud))
|
||||
continue;
|
||||
|
||||
/* Is using a gbpage allowed? */
|
||||
use_gbpage = info->direct_gbpages;
|
||||
|
||||
/* Don't use gbpage if it maps more than the requested region. */
|
||||
/* at the begining: */
|
||||
use_gbpage &= ((addr & ~PUD_MASK) == 0);
|
||||
/* ... or at the end: */
|
||||
use_gbpage &= ((next & ~PUD_MASK) == 0);
|
||||
|
||||
/* Never overwrite existing mappings */
|
||||
use_gbpage &= !pud_present(*pud);
|
||||
|
||||
if (use_gbpage) {
|
||||
pud_t pudval;
|
||||
|
||||
if (pud_present(*pud))
|
||||
continue;
|
||||
|
||||
addr &= PUD_MASK;
|
||||
pudval = __pud((addr - info->offset) | info->page_flag);
|
||||
set_pud(pud, pudval);
|
||||
continue;
|
||||
|
||||
@@ -1064,6 +1064,22 @@ static bool blk_mq_mark_tag_wait(struct blk_mq_hw_ctx *hctx,
|
||||
wait->flags &= ~WQ_FLAG_EXCLUSIVE;
|
||||
__add_wait_queue(wq, wait);
|
||||
|
||||
/*
|
||||
* Add one explicit barrier since blk_mq_get_driver_tag() may
|
||||
* not imply barrier in case of failure.
|
||||
*
|
||||
* Order adding us to wait queue and allocating driver tag.
|
||||
*
|
||||
* The pair is the one implied in sbitmap_queue_wake_up() which
|
||||
* orders clearing sbitmap tag bits and waitqueue_active() in
|
||||
* __sbitmap_queue_wake_up(), since waitqueue_active() is lockless
|
||||
*
|
||||
* Otherwise, re-order of adding wait queue and getting driver tag
|
||||
* may cause __sbitmap_queue_wake_up() to wake up nothing because
|
||||
* the waitqueue_active() may not observe us in wait queue.
|
||||
*/
|
||||
smp_mb();
|
||||
|
||||
/*
|
||||
* It's possible that a tag was freed in the window between the
|
||||
* allocation failure and adding the hardware queue to the wait
|
||||
|
||||
@@ -317,9 +317,10 @@ static void __exit extlog_exit(void)
|
||||
{
|
||||
edac_set_report_status(old_edac_report_status);
|
||||
mce_unregister_decode_chain(&extlog_mce_dec);
|
||||
((struct extlog_l1_head *)extlog_l1_addr)->flags &= ~FLAG_OS_OPTIN;
|
||||
if (extlog_l1_addr)
|
||||
if (extlog_l1_addr) {
|
||||
((struct extlog_l1_head *)extlog_l1_addr)->flags &= ~FLAG_OS_OPTIN;
|
||||
acpi_os_unmap_iomem(extlog_l1_addr, l1_size);
|
||||
}
|
||||
if (elog_addr)
|
||||
acpi_os_unmap_iomem(elog_addr, elog_size);
|
||||
release_mem_region(elog_base, elog_size);
|
||||
|
||||
@@ -581,6 +581,15 @@ static const struct dmi_system_id video_dmi_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 3350"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = video_set_report_key_events,
|
||||
.driver_data = (void *)((uintptr_t)REPORT_BRIGHTNESS_KEY_EVENTS),
|
||||
.ident = "COLORFUL X15 AT 23",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "COLORFUL"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "X15 AT 23"),
|
||||
},
|
||||
},
|
||||
/*
|
||||
* Some machines change the brightness themselves when a brightness
|
||||
* hotkey gets pressed, despite us telling them not to. In this case
|
||||
|
||||
@@ -850,6 +850,16 @@ binder_enqueue_thread_work_ilocked(struct binder_thread *thread,
|
||||
{
|
||||
WARN_ON(!list_empty(&thread->waiting_thread_node));
|
||||
binder_enqueue_work_ilocked(work, &thread->todo);
|
||||
|
||||
/* (e)poll-based threads require an explicit wakeup signal when
|
||||
* queuing their own work; they rely on these events to consume
|
||||
* messages without I/O block. Without it, threads risk waiting
|
||||
* indefinitely without handling the work.
|
||||
*/
|
||||
if (thread->looper & BINDER_LOOPER_STATE_POLL &&
|
||||
thread->pid == current->pid && !thread->process_todo)
|
||||
wake_up_interruptible_sync(&thread->wait);
|
||||
|
||||
thread->process_todo = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2936,6 +2936,8 @@ open_card_ubr0(struct idt77252_dev *card)
|
||||
vc->scq = alloc_scq(card, vc->class);
|
||||
if (!vc->scq) {
|
||||
printk("%s: can't get SCQ.\n", card->name);
|
||||
kfree(card->vcs[0]);
|
||||
card->vcs[0] = NULL;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
@@ -847,7 +847,7 @@ static int __init genpd_power_off_unused(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
late_initcall(genpd_power_off_unused);
|
||||
late_initcall_sync(genpd_power_off_unused);
|
||||
|
||||
#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_GENERIC_DOMAINS_OF)
|
||||
|
||||
|
||||
@@ -481,8 +481,10 @@ static void __init hi3620_mmc_clk_init(struct device_node *node)
|
||||
return;
|
||||
|
||||
clk_data->clks = kcalloc(num, sizeof(*clk_data->clks), GFP_KERNEL);
|
||||
if (!clk_data->clks)
|
||||
if (!clk_data->clks) {
|
||||
kfree(clk_data);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
struct hisi_mmc_clock *mmc_clk = &hi3620_mmc_clks[i];
|
||||
|
||||
@@ -258,18 +258,21 @@ static void __init pxa168_clk_init(struct device_node *np)
|
||||
pxa_unit->mpmu_base = of_iomap(np, 0);
|
||||
if (!pxa_unit->mpmu_base) {
|
||||
pr_err("failed to map mpmu registers\n");
|
||||
kfree(pxa_unit);
|
||||
return;
|
||||
}
|
||||
|
||||
pxa_unit->apmu_base = of_iomap(np, 1);
|
||||
if (!pxa_unit->apmu_base) {
|
||||
pr_err("failed to map apmu registers\n");
|
||||
kfree(pxa_unit);
|
||||
return;
|
||||
}
|
||||
|
||||
pxa_unit->apbc_base = of_iomap(np, 2);
|
||||
if (!pxa_unit->apbc_base) {
|
||||
pr_err("failed to map apbc registers\n");
|
||||
kfree(pxa_unit);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ static struct stm32_crc *stm32_crc_get_next_crc(void)
|
||||
struct stm32_crc *crc;
|
||||
|
||||
spin_lock_bh(&crc_list.lock);
|
||||
crc = list_first_entry(&crc_list.dev_list, struct stm32_crc, list);
|
||||
crc = list_first_entry_or_null(&crc_list.dev_list, struct stm32_crc, list);
|
||||
if (crc)
|
||||
list_move_tail(&crc->list, &crc_list.dev_list);
|
||||
spin_unlock_bh(&crc_list.lock);
|
||||
|
||||
@@ -113,10 +113,9 @@ static int textual_leaf_to_string(const u32 *block, char *buf, size_t size)
|
||||
* @buf: where to put the string
|
||||
* @size: size of @buf, in bytes
|
||||
*
|
||||
* The string is taken from a minimal ASCII text descriptor leaf after
|
||||
* the immediate entry with @key. The string is zero-terminated.
|
||||
* An overlong string is silently truncated such that it and the
|
||||
* zero byte fit into @size.
|
||||
* The string is taken from a minimal ASCII text descriptor leaf just after the entry with the
|
||||
* @key. The string is zero-terminated. An overlong string is silently truncated such that it
|
||||
* and the zero byte fit into @size.
|
||||
*
|
||||
* Returns strlen(buf) or a negative error code.
|
||||
*/
|
||||
|
||||
@@ -318,20 +318,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
|
||||
switch (flow_type) {
|
||||
case IRQ_TYPE_LEVEL_HIGH:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1);
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_LOW:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1);
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_RISING:
|
||||
case IRQ_TYPE_EDGE_FALLING:
|
||||
case IRQ_TYPE_EDGE_BOTH:
|
||||
state = sprd_eic_get(chip, offset);
|
||||
if (state)
|
||||
if (state) {
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_DBNC_IEV, 0);
|
||||
else
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_DBNC_IC, 1);
|
||||
} else {
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_DBNC_IEV, 1);
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_DBNC_IC, 1);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
@@ -343,20 +350,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
|
||||
switch (flow_type) {
|
||||
case IRQ_TYPE_LEVEL_HIGH:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1);
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_LOW:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1);
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_RISING:
|
||||
case IRQ_TYPE_EDGE_FALLING:
|
||||
case IRQ_TYPE_EDGE_BOTH:
|
||||
state = sprd_eic_get(chip, offset);
|
||||
if (state)
|
||||
if (state) {
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_LATCH_INTPOL, 0);
|
||||
else
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_LATCH_INTCLR, 1);
|
||||
} else {
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_LATCH_INTPOL, 1);
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_LATCH_INTCLR, 1);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
@@ -370,29 +384,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_FALLING:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_BOTH:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_HIGH:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_level_irq);
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_LOW:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_level_irq);
|
||||
break;
|
||||
default:
|
||||
@@ -405,29 +424,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_FALLING:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_BOTH:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_HIGH:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_level_irq);
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_LOW:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_level_irq);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1427,6 +1427,20 @@ static const struct dmi_system_id gpiolib_acpi_quirks[] = {
|
||||
.ignore_wake = "INT33FF:01@0",
|
||||
},
|
||||
},
|
||||
{
|
||||
/*
|
||||
* Spurious wakeups from TP_ATTN# pin
|
||||
* Found in BIOS 0.35
|
||||
* https://gitlab.freedesktop.org/drm/amd/-/issues/3073
|
||||
*/
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "GPD"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "G1619-04"),
|
||||
},
|
||||
.driver_data = &(struct acpi_gpiolib_dmi_quirk) {
|
||||
.ignore_wake = "PNP0C50:00@8",
|
||||
},
|
||||
},
|
||||
{} /* Terminating entry */
|
||||
};
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ struct amdgpu_amdkfd_fence *to_amdgpu_amdkfd_fence(struct dma_fence *f)
|
||||
return NULL;
|
||||
|
||||
fence = container_of(f, struct amdgpu_amdkfd_fence, base);
|
||||
if (fence && f->ops == &amdkfd_fence_ops)
|
||||
if (f->ops == &amdkfd_fence_ops)
|
||||
return fence;
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -823,6 +823,7 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
|
||||
return true;
|
||||
|
||||
fw_ver = *((uint32_t *)adev->pm.fw->data + 69);
|
||||
release_firmware(adev->pm.fw);
|
||||
if (fw_ver < 0x00160e00)
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -219,7 +219,8 @@ int amdgpu_sync_resv(struct amdgpu_device *adev,
|
||||
*/
|
||||
fence_owner = amdgpu_sync_get_owner(f);
|
||||
if (fence_owner == AMDGPU_FENCE_OWNER_KFD &&
|
||||
owner != AMDGPU_FENCE_OWNER_UNDEFINED)
|
||||
owner != AMDGPU_FENCE_OWNER_UNDEFINED &&
|
||||
owner != AMDGPU_FENCE_OWNER_KFD)
|
||||
continue;
|
||||
|
||||
if (amdgpu_sync_same_dev(adev, f)) {
|
||||
|
||||
@@ -64,13 +64,13 @@ static int ptn3460_read_bytes(struct ptn3460_bridge *ptn_bridge, char addr,
|
||||
int ret;
|
||||
|
||||
ret = i2c_master_send(ptn_bridge->client, &addr, 1);
|
||||
if (ret <= 0) {
|
||||
if (ret < 0) {
|
||||
DRM_ERROR("Failed to send i2c command, ret=%d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = i2c_master_recv(ptn_bridge->client, buf, len);
|
||||
if (ret <= 0) {
|
||||
if (ret < 0) {
|
||||
DRM_ERROR("Failed to recv i2c data, ret=%d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -88,7 +88,7 @@ static int ptn3460_write_byte(struct ptn3460_bridge *ptn_bridge, char addr,
|
||||
buf[1] = val;
|
||||
|
||||
ret = i2c_master_send(ptn_bridge->client, buf, ARRAY_SIZE(buf));
|
||||
if (ret <= 0) {
|
||||
if (ret < 0) {
|
||||
DRM_ERROR("Failed to send i2c command, ret=%d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ int drm_open(struct inode *inode, struct file *filp)
|
||||
{
|
||||
struct drm_device *dev;
|
||||
struct drm_minor *minor;
|
||||
int retcode;
|
||||
int retcode = 0;
|
||||
int need_setup = 0;
|
||||
|
||||
minor = drm_minor_acquire(iminor(inode));
|
||||
|
||||
@@ -539,7 +539,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
|
||||
struct drm_framebuffer *fb;
|
||||
unsigned flags;
|
||||
int num_clips;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
return -EINVAL;
|
||||
|
||||
@@ -305,7 +305,8 @@ static int mipi_dsi_remove_device_fn(struct device *dev, void *priv)
|
||||
{
|
||||
struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev);
|
||||
|
||||
mipi_dsi_detach(dsi);
|
||||
if (dsi->attached)
|
||||
mipi_dsi_detach(dsi);
|
||||
mipi_dsi_device_unregister(dsi);
|
||||
|
||||
return 0;
|
||||
@@ -328,11 +329,18 @@ EXPORT_SYMBOL(mipi_dsi_host_unregister);
|
||||
int mipi_dsi_attach(struct mipi_dsi_device *dsi)
|
||||
{
|
||||
const struct mipi_dsi_host_ops *ops = dsi->host->ops;
|
||||
int ret;
|
||||
|
||||
if (!ops || !ops->attach)
|
||||
return -ENOSYS;
|
||||
|
||||
return ops->attach(dsi->host, dsi);
|
||||
ret = ops->attach(dsi->host, dsi);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
dsi->attached = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(mipi_dsi_attach);
|
||||
|
||||
@@ -344,9 +352,14 @@ int mipi_dsi_detach(struct mipi_dsi_device *dsi)
|
||||
{
|
||||
const struct mipi_dsi_host_ops *ops = dsi->host->ops;
|
||||
|
||||
if (WARN_ON(!dsi->attached))
|
||||
return -EINVAL;
|
||||
|
||||
if (!ops || !ops->detach)
|
||||
return -ENOSYS;
|
||||
|
||||
dsi->attached = false;
|
||||
|
||||
return ops->detach(dsi->host, dsi);
|
||||
}
|
||||
EXPORT_SYMBOL(mipi_dsi_detach);
|
||||
|
||||
@@ -1183,6 +1183,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
|
||||
out:
|
||||
if (fb)
|
||||
drm_framebuffer_put(fb);
|
||||
fb = NULL;
|
||||
if (plane->old_fb)
|
||||
drm_framebuffer_put(plane->old_fb);
|
||||
plane->old_fb = NULL;
|
||||
|
||||
@@ -410,6 +410,7 @@ static int exynos_drm_bind(struct device *dev)
|
||||
drm_release_iommu_mapping(drm);
|
||||
err_free_private:
|
||||
kfree(private);
|
||||
dev_set_drvdata(dev, NULL);
|
||||
err_free_drm:
|
||||
drm_dev_put(drm);
|
||||
|
||||
@@ -424,6 +425,7 @@ static void exynos_drm_unbind(struct device *dev)
|
||||
|
||||
exynos_drm_fbdev_fini(drm);
|
||||
drm_kms_helper_poll_fini(drm);
|
||||
drm_atomic_helper_shutdown(drm);
|
||||
|
||||
component_unbind_all(drm->dev, drm);
|
||||
drm_mode_config_cleanup(drm);
|
||||
@@ -461,9 +463,18 @@ static int exynos_drm_platform_remove(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void exynos_drm_platform_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct drm_device *drm = platform_get_drvdata(pdev);
|
||||
|
||||
if (drm)
|
||||
drm_atomic_helper_shutdown(drm);
|
||||
}
|
||||
|
||||
static struct platform_driver exynos_drm_platform_driver = {
|
||||
.probe = exynos_drm_platform_probe,
|
||||
.remove = exynos_drm_platform_remove,
|
||||
.shutdown = exynos_drm_platform_shutdown,
|
||||
.driver = {
|
||||
.name = "exynos-drm",
|
||||
.pm = &exynos_drm_pm_ops,
|
||||
|
||||
@@ -1322,7 +1322,7 @@ static int __maybe_unused gsc_runtime_resume(struct device *dev)
|
||||
for (i = 0; i < ctx->num_clocks; i++) {
|
||||
ret = clk_prepare_enable(ctx->clocks[i]);
|
||||
if (ret) {
|
||||
while (--i > 0)
|
||||
while (--i >= 0)
|
||||
clk_disable_unprepare(ctx->clocks[i]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,9 @@
|
||||
(p) ? ((p)->hw_pp ? (p)->hw_pp->idx - PINGPONG_0 : -1) : -1, \
|
||||
##__VA_ARGS__)
|
||||
|
||||
#define DPU_ERROR_ENC_RATELIMITED(e, fmt, ...) DPU_ERROR_RATELIMITED("enc%d " fmt,\
|
||||
(e) ? (e)->base.base.id : -1, ##__VA_ARGS__)
|
||||
|
||||
/*
|
||||
* Two to anticipate panels that can do cmd/vid dynamic switching
|
||||
* plan is to create all possible physical encoder types, and switch between
|
||||
@@ -2326,7 +2329,7 @@ static void dpu_encoder_frame_done_timeout(struct timer_list *t)
|
||||
return;
|
||||
}
|
||||
|
||||
DPU_ERROR_ENC(dpu_enc, "frame done timeout\n");
|
||||
DPU_ERROR_ENC_RATELIMITED(dpu_enc, "frame done timeout\n");
|
||||
|
||||
event = DPU_ENCODER_FRAME_EVENT_ERROR;
|
||||
trace_dpu_enc_frame_done_timeout(DRMID(drm_enc), event);
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
} while (0)
|
||||
|
||||
#define DPU_ERROR(fmt, ...) pr_err("[dpu error]" fmt, ##__VA_ARGS__)
|
||||
#define DPU_ERROR_RATELIMITED(fmt, ...) pr_err_ratelimited("[dpu error]" fmt, ##__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* ktime_compare_safe - compare two ktime structures
|
||||
|
||||
@@ -54,6 +54,12 @@ MODULE_PARM_DESC(swap_opt_cmd, "Swap the Option (\"Alt\") and Command (\"Flag\")
|
||||
"(For people who want to keep Windows PC keyboard muscle memory. "
|
||||
"[0] = as-is, Mac layout. 1 = swapped, Windows layout.)");
|
||||
|
||||
static unsigned int swap_fn_leftctrl;
|
||||
module_param(swap_fn_leftctrl, uint, 0644);
|
||||
MODULE_PARM_DESC(swap_fn_leftctrl, "Swap the Fn and left Control keys. "
|
||||
"(For people who want to keep PC keyboard muscle memory. "
|
||||
"[0] = as-is, Mac layout, 1 = swapped, PC layout)");
|
||||
|
||||
struct apple_sc {
|
||||
unsigned long quirks;
|
||||
unsigned int fn_on;
|
||||
@@ -67,6 +73,28 @@ struct apple_key_translation {
|
||||
u8 flags;
|
||||
};
|
||||
|
||||
static const struct apple_key_translation apple2021_fn_keys[] = {
|
||||
{ KEY_BACKSPACE, KEY_DELETE },
|
||||
{ KEY_ENTER, KEY_INSERT },
|
||||
{ KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY },
|
||||
{ KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY },
|
||||
{ KEY_F3, KEY_SCALE, APPLE_FLAG_FKEY },
|
||||
{ KEY_F4, KEY_SEARCH, APPLE_FLAG_FKEY },
|
||||
{ KEY_F5, KEY_MICMUTE, APPLE_FLAG_FKEY },
|
||||
{ KEY_F6, KEY_SLEEP, APPLE_FLAG_FKEY },
|
||||
{ KEY_F7, KEY_PREVIOUSSONG, APPLE_FLAG_FKEY },
|
||||
{ KEY_F8, KEY_PLAYPAUSE, APPLE_FLAG_FKEY },
|
||||
{ KEY_F9, KEY_NEXTSONG, APPLE_FLAG_FKEY },
|
||||
{ KEY_F10, KEY_MUTE, APPLE_FLAG_FKEY },
|
||||
{ KEY_F11, KEY_VOLUMEDOWN, APPLE_FLAG_FKEY },
|
||||
{ KEY_F12, KEY_VOLUMEUP, APPLE_FLAG_FKEY },
|
||||
{ KEY_UP, KEY_PAGEUP },
|
||||
{ KEY_DOWN, KEY_PAGEDOWN },
|
||||
{ KEY_LEFT, KEY_HOME },
|
||||
{ KEY_RIGHT, KEY_END },
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct apple_key_translation macbookair_fn_keys[] = {
|
||||
{ KEY_BACKSPACE, KEY_DELETE },
|
||||
{ KEY_ENTER, KEY_INSERT },
|
||||
@@ -166,6 +194,11 @@ static const struct apple_key_translation swapped_option_cmd_keys[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct apple_key_translation swapped_fn_leftctrl_keys[] = {
|
||||
{ KEY_FN, KEY_LEFTCTRL },
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct apple_key_translation *apple_find_translation(
|
||||
const struct apple_key_translation *table, u16 from)
|
||||
{
|
||||
@@ -187,14 +220,18 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
|
||||
bool do_translate;
|
||||
u16 code = 0;
|
||||
|
||||
if (usage->code == KEY_FN) {
|
||||
u16 fn_keycode = (swap_fn_leftctrl) ? (KEY_LEFTCTRL) : (KEY_FN);
|
||||
|
||||
if (usage->code == fn_keycode) {
|
||||
asc->fn_on = !!value;
|
||||
input_event(input, usage->type, usage->code, value);
|
||||
input_event(input, usage->type, KEY_FN, value);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (fnmode) {
|
||||
if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
|
||||
if (hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021)
|
||||
table = apple2021_fn_keys;
|
||||
else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
|
||||
hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS)
|
||||
table = macbookair_fn_keys;
|
||||
else if (hid->product < 0x21d || hid->product >= 0x300)
|
||||
@@ -274,6 +311,14 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
|
||||
}
|
||||
}
|
||||
|
||||
if (swap_fn_leftctrl) {
|
||||
trans = apple_find_translation(swapped_fn_leftctrl_keys, usage->code);
|
||||
if (trans) {
|
||||
input_event(input, usage->type, trans->to, value);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -344,6 +389,14 @@ static void apple_setup_input(struct input_dev *input)
|
||||
|
||||
for (trans = apple_iso_keyboard; trans->from; trans++)
|
||||
set_bit(trans->to, input->keybit);
|
||||
|
||||
for (trans = apple2021_fn_keys; trans->from; trans++)
|
||||
set_bit(trans->to, input->keybit);
|
||||
|
||||
if (swap_fn_leftctrl) {
|
||||
for (trans = swapped_fn_leftctrl_keys; trans->from; trans++)
|
||||
set_bit(trans->to, input->keybit);
|
||||
}
|
||||
}
|
||||
|
||||
static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi,
|
||||
@@ -599,6 +652,10 @@ static const struct hid_device_id apple_devices[] = {
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
|
||||
.driver_data = APPLE_HAS_FN },
|
||||
{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
|
||||
.driver_data = APPLE_HAS_FN },
|
||||
|
||||
{ }
|
||||
};
|
||||
|
||||
@@ -176,6 +176,7 @@
|
||||
#define USB_DEVICE_ID_APPLE_IRCONTROL3 0x8241
|
||||
#define USB_DEVICE_ID_APPLE_IRCONTROL4 0x8242
|
||||
#define USB_DEVICE_ID_APPLE_IRCONTROL5 0x8243
|
||||
#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 0x029c
|
||||
|
||||
#define USB_VENDOR_ID_ASUS 0x0486
|
||||
#define USB_DEVICE_ID_ASUS_T91MT 0x0185
|
||||
|
||||
@@ -301,6 +301,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021) },
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_HID_APPLEIR)
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) },
|
||||
|
||||
@@ -2059,7 +2059,7 @@ static int wacom_allocate_inputs(struct wacom *wacom)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int wacom_register_inputs(struct wacom *wacom)
|
||||
static int wacom_setup_inputs(struct wacom *wacom)
|
||||
{
|
||||
struct input_dev *pen_input_dev, *touch_input_dev, *pad_input_dev;
|
||||
struct wacom_wac *wacom_wac = &(wacom->wacom_wac);
|
||||
@@ -2078,10 +2078,6 @@ static int wacom_register_inputs(struct wacom *wacom)
|
||||
input_free_device(pen_input_dev);
|
||||
wacom_wac->pen_input = NULL;
|
||||
pen_input_dev = NULL;
|
||||
} else {
|
||||
error = input_register_device(pen_input_dev);
|
||||
if (error)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
error = wacom_setup_touch_input_capabilities(touch_input_dev, wacom_wac);
|
||||
@@ -2090,10 +2086,6 @@ static int wacom_register_inputs(struct wacom *wacom)
|
||||
input_free_device(touch_input_dev);
|
||||
wacom_wac->touch_input = NULL;
|
||||
touch_input_dev = NULL;
|
||||
} else {
|
||||
error = input_register_device(touch_input_dev);
|
||||
if (error)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
error = wacom_setup_pad_input_capabilities(pad_input_dev, wacom_wac);
|
||||
@@ -2102,7 +2094,34 @@ static int wacom_register_inputs(struct wacom *wacom)
|
||||
input_free_device(pad_input_dev);
|
||||
wacom_wac->pad_input = NULL;
|
||||
pad_input_dev = NULL;
|
||||
} else {
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int wacom_register_inputs(struct wacom *wacom)
|
||||
{
|
||||
struct input_dev *pen_input_dev, *touch_input_dev, *pad_input_dev;
|
||||
struct wacom_wac *wacom_wac = &(wacom->wacom_wac);
|
||||
int error = 0;
|
||||
|
||||
pen_input_dev = wacom_wac->pen_input;
|
||||
touch_input_dev = wacom_wac->touch_input;
|
||||
pad_input_dev = wacom_wac->pad_input;
|
||||
|
||||
if (pen_input_dev) {
|
||||
error = input_register_device(pen_input_dev);
|
||||
if (error)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (touch_input_dev) {
|
||||
error = input_register_device(touch_input_dev);
|
||||
if (error)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (pad_input_dev) {
|
||||
error = input_register_device(pad_input_dev);
|
||||
if (error)
|
||||
goto fail;
|
||||
@@ -2352,6 +2371,20 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
error = wacom_setup_inputs(wacom);
|
||||
if (error)
|
||||
goto fail;
|
||||
|
||||
if (features->type == HID_GENERIC)
|
||||
connect_mask |= HID_CONNECT_DRIVER;
|
||||
|
||||
/* Regular HID work starts now */
|
||||
error = hid_hw_start(hdev, connect_mask);
|
||||
if (error) {
|
||||
hid_err(hdev, "hw start failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
error = wacom_register_inputs(wacom);
|
||||
if (error)
|
||||
goto fail;
|
||||
@@ -2366,16 +2399,6 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (features->type == HID_GENERIC)
|
||||
connect_mask |= HID_CONNECT_DRIVER;
|
||||
|
||||
/* Regular HID work starts now */
|
||||
error = hid_hw_start(hdev, connect_mask);
|
||||
if (error) {
|
||||
hid_err(hdev, "hw start failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!wireless) {
|
||||
/* Note that if query fails it is not a hard failure */
|
||||
wacom_query_tablet_data(wacom);
|
||||
|
||||
@@ -2461,7 +2461,14 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
|
||||
wacom_wac->hid_data.tipswitch);
|
||||
input_report_key(input, wacom_wac->tool[0], sense);
|
||||
if (wacom_wac->serial[0]) {
|
||||
input_event(input, EV_MSC, MSC_SERIAL, wacom_wac->serial[0]);
|
||||
/*
|
||||
* xf86-input-wacom does not accept a serial number
|
||||
* of '0'. Report the low 32 bits if possible, but
|
||||
* if they are zero, report the upper ones instead.
|
||||
*/
|
||||
__u32 serial_lo = wacom_wac->serial[0] & 0xFFFFFFFFu;
|
||||
__u32 serial_hi = wacom_wac->serial[0] >> 32;
|
||||
input_event(input, EV_MSC, MSC_SERIAL, (int)(serial_lo ? serial_lo : serial_hi));
|
||||
input_report_abs(input, ABS_MISC, sense ? id : 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -197,6 +197,8 @@ struct aspeed_pwm_tacho_data {
|
||||
u8 fan_tach_ch_source[16];
|
||||
struct aspeed_cooling_device *cdev[8];
|
||||
const struct attribute_group *groups[3];
|
||||
/* protects access to shared ASPEED_PTCR_RESULT */
|
||||
struct mutex tach_lock;
|
||||
};
|
||||
|
||||
enum type { TYPEM, TYPEN, TYPEO };
|
||||
@@ -531,6 +533,8 @@ static int aspeed_get_fan_tach_ch_rpm(struct aspeed_pwm_tacho_data *priv,
|
||||
u8 fan_tach_ch_source, type, mode, both;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&priv->tach_lock);
|
||||
|
||||
regmap_write(priv->regmap, ASPEED_PTCR_TRIGGER, 0);
|
||||
regmap_write(priv->regmap, ASPEED_PTCR_TRIGGER, 0x1 << fan_tach_ch);
|
||||
|
||||
@@ -548,6 +552,8 @@ static int aspeed_get_fan_tach_ch_rpm(struct aspeed_pwm_tacho_data *priv,
|
||||
ASPEED_RPM_STATUS_SLEEP_USEC,
|
||||
usec);
|
||||
|
||||
mutex_unlock(&priv->tach_lock);
|
||||
|
||||
/* return -ETIMEDOUT if we didn't get an answer. */
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -938,6 +944,7 @@ static int aspeed_pwm_tacho_probe(struct platform_device *pdev)
|
||||
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
mutex_init(&priv->tach_lock);
|
||||
priv->regmap = devm_regmap_init(dev, NULL, (__force void *)regs,
|
||||
&aspeed_pwm_tacho_regmap_config);
|
||||
if (IS_ERR(priv->regmap))
|
||||
|
||||
@@ -393,7 +393,7 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
|
||||
}
|
||||
|
||||
static int create_core_attrs(struct temp_data *tdata, struct device *dev,
|
||||
int attr_no)
|
||||
int index)
|
||||
{
|
||||
int i;
|
||||
static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev,
|
||||
@@ -405,13 +405,20 @@ static int create_core_attrs(struct temp_data *tdata, struct device *dev,
|
||||
};
|
||||
|
||||
for (i = 0; i < tdata->attr_size; i++) {
|
||||
/*
|
||||
* We map the attr number to core id of the CPU
|
||||
* The attr number is always core id + 2
|
||||
* The Pkgtemp will always show up as temp1_*, if available
|
||||
*/
|
||||
int attr_no = tdata->is_pkg_data ? 1 : tdata->cpu_core_id + 2;
|
||||
|
||||
snprintf(tdata->attr_name[i], CORETEMP_NAME_LENGTH,
|
||||
"temp%d_%s", attr_no, suffixes[i]);
|
||||
sysfs_attr_init(&tdata->sd_attrs[i].dev_attr.attr);
|
||||
tdata->sd_attrs[i].dev_attr.attr.name = tdata->attr_name[i];
|
||||
tdata->sd_attrs[i].dev_attr.attr.mode = S_IRUGO;
|
||||
tdata->sd_attrs[i].dev_attr.show = rd_ptr[i];
|
||||
tdata->sd_attrs[i].index = attr_no;
|
||||
tdata->sd_attrs[i].index = index;
|
||||
tdata->attrs[i] = &tdata->sd_attrs[i].dev_attr.attr;
|
||||
}
|
||||
tdata->attr_group.attrs = tdata->attrs;
|
||||
@@ -469,27 +476,22 @@ static int create_core_data(struct platform_device *pdev, unsigned int cpu,
|
||||
struct platform_data *pdata = platform_get_drvdata(pdev);
|
||||
struct cpuinfo_x86 *c = &cpu_data(cpu);
|
||||
u32 eax, edx;
|
||||
int err, index, attr_no;
|
||||
int err, index;
|
||||
|
||||
/*
|
||||
* Find attr number for sysfs:
|
||||
* We map the attr number to core id of the CPU
|
||||
* The attr number is always core id + 2
|
||||
* The Pkgtemp will always show up as temp1_*, if available
|
||||
* Get the index of tdata in pdata->core_data[]
|
||||
* tdata for package: pdata->core_data[1]
|
||||
* tdata for core: pdata->core_data[2] .. pdata->core_data[NUM_REAL_CORES + 1]
|
||||
*/
|
||||
if (pkg_flag) {
|
||||
attr_no = PKG_SYSFS_ATTR_NO;
|
||||
index = PKG_SYSFS_ATTR_NO;
|
||||
} else {
|
||||
index = ida_alloc(&pdata->ida, GFP_KERNEL);
|
||||
index = ida_alloc_max(&pdata->ida, NUM_REAL_CORES - 1, GFP_KERNEL);
|
||||
if (index < 0)
|
||||
return index;
|
||||
pdata->cpu_map[index] = topology_core_id(cpu);
|
||||
attr_no = index + BASE_SYSFS_ATTR_NO;
|
||||
}
|
||||
|
||||
if (attr_no > MAX_CORE_DATA - 1) {
|
||||
err = -ERANGE;
|
||||
goto ida_free;
|
||||
pdata->cpu_map[index] = topology_core_id(cpu);
|
||||
index += BASE_SYSFS_ATTR_NO;
|
||||
}
|
||||
|
||||
tdata = init_temp_data(cpu, pkg_flag);
|
||||
@@ -521,20 +523,20 @@ static int create_core_data(struct platform_device *pdev, unsigned int cpu,
|
||||
}
|
||||
}
|
||||
|
||||
pdata->core_data[attr_no] = tdata;
|
||||
pdata->core_data[index] = tdata;
|
||||
|
||||
/* Create sysfs interfaces */
|
||||
err = create_core_attrs(tdata, pdata->hwmon_dev, attr_no);
|
||||
err = create_core_attrs(tdata, pdata->hwmon_dev, index);
|
||||
if (err)
|
||||
goto exit_free;
|
||||
|
||||
return 0;
|
||||
exit_free:
|
||||
pdata->core_data[attr_no] = NULL;
|
||||
pdata->core_data[index] = NULL;
|
||||
kfree(tdata);
|
||||
ida_free:
|
||||
if (!pkg_flag)
|
||||
ida_free(&pdata->ida, index);
|
||||
ida_free(&pdata->ida, index - BASE_SYSFS_ATTR_NO);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -543,21 +543,18 @@ static int ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast)
|
||||
/* SM supports sendonly-fullmember, otherwise fallback to full-member */
|
||||
rec.join_state = SENDONLY_FULLMEMBER_JOIN;
|
||||
}
|
||||
spin_unlock_irq(&priv->lock);
|
||||
|
||||
multicast = ib_sa_join_multicast(&ipoib_sa_client, priv->ca, priv->port,
|
||||
&rec, comp_mask, GFP_KERNEL,
|
||||
&rec, comp_mask, GFP_ATOMIC,
|
||||
ipoib_mcast_join_complete, mcast);
|
||||
spin_lock_irq(&priv->lock);
|
||||
if (IS_ERR(multicast)) {
|
||||
ret = PTR_ERR(multicast);
|
||||
ipoib_warn(priv, "ib_sa_join_multicast failed, status %d\n", ret);
|
||||
/* Requeue this join task with a backoff delay */
|
||||
__ipoib_mcast_schedule_join_thread(priv, mcast, 1);
|
||||
clear_bit(IPOIB_MCAST_FLAG_BUSY, &mcast->flags);
|
||||
spin_unlock_irq(&priv->lock);
|
||||
complete(&mcast->done);
|
||||
spin_lock_irq(&priv->lock);
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -763,7 +763,6 @@ static int atkbd_probe(struct atkbd *atkbd)
|
||||
{
|
||||
struct ps2dev *ps2dev = &atkbd->ps2dev;
|
||||
unsigned char param[2];
|
||||
bool skip_getid;
|
||||
|
||||
/*
|
||||
* Some systems, where the bit-twiddling when testing the io-lines of the
|
||||
@@ -777,6 +776,11 @@ static int atkbd_probe(struct atkbd *atkbd)
|
||||
"keyboard reset failed on %s\n",
|
||||
ps2dev->serio->phys);
|
||||
|
||||
if (atkbd_skip_getid(atkbd)) {
|
||||
atkbd->id = 0xab83;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Then we check the keyboard ID. We should get 0xab83 under normal conditions.
|
||||
* Some keyboards report different values, but the first byte is always 0xab or
|
||||
@@ -785,18 +789,17 @@ static int atkbd_probe(struct atkbd *atkbd)
|
||||
*/
|
||||
|
||||
param[0] = param[1] = 0xa5; /* initialize with invalid values */
|
||||
skip_getid = atkbd_skip_getid(atkbd);
|
||||
if (skip_getid || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
|
||||
if (ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
|
||||
|
||||
/*
|
||||
* If the get ID command was skipped or failed, we check if we can at least set
|
||||
* If the get ID command failed, we check if we can at least set
|
||||
* the LEDs on the keyboard. This should work on every keyboard out there.
|
||||
* It also turns the LEDs off, which we want anyway.
|
||||
*/
|
||||
param[0] = 0;
|
||||
if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS))
|
||||
return -1;
|
||||
atkbd->id = skip_getid ? 0xab83 : 0xabba;
|
||||
atkbd->id = 0xabba;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -121,6 +121,9 @@ static void brcmstb_l2_intc_irq_handle(struct irq_desc *desc)
|
||||
generic_handle_irq(irq_linear_revmap(b->domain, irq));
|
||||
} while (status);
|
||||
out:
|
||||
/* Don't ack parent before all device writes are done */
|
||||
wmb();
|
||||
|
||||
chained_irq_exit(chip, desc);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,10 +67,13 @@ static long led_panic_blink(int state)
|
||||
|
||||
static int __init ledtrig_panic_init(void)
|
||||
{
|
||||
led_trigger_register_simple("panic", &trigger);
|
||||
if (!trigger)
|
||||
return -ENOMEM;
|
||||
|
||||
atomic_notifier_chain_register(&panic_notifier_list,
|
||||
&led_trigger_panic_nb);
|
||||
|
||||
led_trigger_register_simple("panic", &trigger);
|
||||
panic_blink = led_panic_blink;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1034,6 +1034,7 @@ struct super_type {
|
||||
struct md_rdev *refdev,
|
||||
int minor_version);
|
||||
int (*validate_super)(struct mddev *mddev,
|
||||
struct md_rdev *freshest,
|
||||
struct md_rdev *rdev);
|
||||
void (*sync_super)(struct mddev *mddev,
|
||||
struct md_rdev *rdev);
|
||||
@@ -1160,8 +1161,9 @@ static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor
|
||||
|
||||
/*
|
||||
* validate_super for 0.90.0
|
||||
* note: we are not using "freshest" for 0.9 superblock
|
||||
*/
|
||||
static int super_90_validate(struct mddev *mddev, struct md_rdev *rdev)
|
||||
static int super_90_validate(struct mddev *mddev, struct md_rdev *freshest, struct md_rdev *rdev)
|
||||
{
|
||||
mdp_disk_t *desc;
|
||||
mdp_super_t *sb = page_address(rdev->sb_page);
|
||||
@@ -1665,7 +1667,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev)
|
||||
static int super_1_validate(struct mddev *mddev, struct md_rdev *freshest, struct md_rdev *rdev)
|
||||
{
|
||||
struct mdp_superblock_1 *sb = page_address(rdev->sb_page);
|
||||
__u64 ev1 = le64_to_cpu(sb->events);
|
||||
@@ -1761,13 +1763,15 @@ static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev)
|
||||
}
|
||||
} else if (mddev->pers == NULL) {
|
||||
/* Insist of good event counter while assembling, except for
|
||||
* spares (which don't need an event count) */
|
||||
++ev1;
|
||||
* spares (which don't need an event count).
|
||||
* Similar to mdadm, we allow event counter difference of 1
|
||||
* from the freshest device.
|
||||
*/
|
||||
if (rdev->desc_nr >= 0 &&
|
||||
rdev->desc_nr < le32_to_cpu(sb->max_dev) &&
|
||||
(le16_to_cpu(sb->dev_roles[rdev->desc_nr]) < MD_DISK_ROLE_MAX ||
|
||||
le16_to_cpu(sb->dev_roles[rdev->desc_nr]) == MD_DISK_ROLE_JOURNAL))
|
||||
if (ev1 < mddev->events)
|
||||
if (ev1 + 1 < mddev->events)
|
||||
return -EINVAL;
|
||||
} else if (mddev->bitmap) {
|
||||
/* If adding to array with a bitmap, then we can accept an
|
||||
@@ -1788,8 +1792,38 @@ static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev)
|
||||
rdev->desc_nr >= le32_to_cpu(sb->max_dev)) {
|
||||
role = MD_DISK_ROLE_SPARE;
|
||||
rdev->desc_nr = -1;
|
||||
} else
|
||||
} else if (mddev->pers == NULL && freshest && ev1 < mddev->events) {
|
||||
/*
|
||||
* If we are assembling, and our event counter is smaller than the
|
||||
* highest event counter, we cannot trust our superblock about the role.
|
||||
* It could happen that our rdev was marked as Faulty, and all other
|
||||
* superblocks were updated with +1 event counter.
|
||||
* Then, before the next superblock update, which typically happens when
|
||||
* remove_and_add_spares() removes the device from the array, there was
|
||||
* a crash or reboot.
|
||||
* If we allow current rdev without consulting the freshest superblock,
|
||||
* we could cause data corruption.
|
||||
* Note that in this case our event counter is smaller by 1 than the
|
||||
* highest, otherwise, this rdev would not be allowed into array;
|
||||
* both kernel and mdadm allow event counter difference of 1.
|
||||
*/
|
||||
struct mdp_superblock_1 *freshest_sb = page_address(freshest->sb_page);
|
||||
u32 freshest_max_dev = le32_to_cpu(freshest_sb->max_dev);
|
||||
|
||||
if (rdev->desc_nr >= freshest_max_dev) {
|
||||
/* this is unexpected, better not proceed */
|
||||
pr_warn("md: %s: rdev[%pg]: desc_nr(%d) >= freshest(%pg)->sb->max_dev(%u)\n",
|
||||
mdname(mddev), rdev->bdev, rdev->desc_nr,
|
||||
freshest->bdev, freshest_max_dev);
|
||||
return -EUCLEAN;
|
||||
}
|
||||
|
||||
role = le16_to_cpu(freshest_sb->dev_roles[rdev->desc_nr]);
|
||||
pr_debug("md: %s: rdev[%pg]: role=%d(0x%x) according to freshest %pg\n",
|
||||
mdname(mddev), rdev->bdev, role, role, freshest->bdev);
|
||||
} else {
|
||||
role = le16_to_cpu(sb->dev_roles[rdev->desc_nr]);
|
||||
}
|
||||
switch(role) {
|
||||
case MD_DISK_ROLE_SPARE: /* spare */
|
||||
break;
|
||||
@@ -2691,7 +2725,7 @@ static int add_bound_rdev(struct md_rdev *rdev)
|
||||
* and should be added immediately.
|
||||
*/
|
||||
super_types[mddev->major_version].
|
||||
validate_super(mddev, rdev);
|
||||
validate_super(mddev, NULL/*freshest*/, rdev);
|
||||
if (add_journal)
|
||||
mddev_suspend(mddev);
|
||||
err = mddev->pers->hot_add_disk(mddev, rdev);
|
||||
@@ -3593,7 +3627,7 @@ static void analyze_sbs(struct mddev *mddev)
|
||||
}
|
||||
|
||||
super_types[mddev->major_version].
|
||||
validate_super(mddev, freshest);
|
||||
validate_super(mddev, NULL/*freshest*/, freshest);
|
||||
|
||||
i = 0;
|
||||
rdev_for_each_safe(rdev, tmp, mddev) {
|
||||
@@ -3608,7 +3642,7 @@ static void analyze_sbs(struct mddev *mddev)
|
||||
}
|
||||
if (rdev != freshest) {
|
||||
if (super_types[mddev->major_version].
|
||||
validate_super(mddev, rdev)) {
|
||||
validate_super(mddev, freshest, rdev)) {
|
||||
pr_warn("md: kicking non-fresh %s from array!\n",
|
||||
bdevname(rdev->bdev,b));
|
||||
md_kick_rdev_from_array(rdev);
|
||||
@@ -6453,7 +6487,7 @@ static int add_new_disk(struct mddev *mddev, mdu_disk_info_t *info)
|
||||
rdev->saved_raid_disk = rdev->raid_disk;
|
||||
} else
|
||||
super_types[mddev->major_version].
|
||||
validate_super(mddev, rdev);
|
||||
validate_super(mddev, NULL/*freshest*/, rdev);
|
||||
if ((info->state & (1<<MD_DISK_SYNC)) &&
|
||||
rdev->raid_disk != info->raid_disk) {
|
||||
/* This was a hot-add request, but events doesn't
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/raid/pq.h>
|
||||
#include <linux/async_tx.h>
|
||||
@@ -6330,18 +6329,7 @@ static void raid5d(struct md_thread *thread)
|
||||
spin_unlock_irq(&conf->device_lock);
|
||||
md_check_recovery(mddev);
|
||||
spin_lock_irq(&conf->device_lock);
|
||||
|
||||
/*
|
||||
* Waiting on MD_SB_CHANGE_PENDING below may deadlock
|
||||
* seeing md_check_recovery() is needed to clear
|
||||
* the flag when using mdmon.
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
|
||||
wait_event_lock_irq(mddev->sb_wait,
|
||||
!test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags),
|
||||
conf->device_lock);
|
||||
}
|
||||
pr_debug("%d stripes handled\n", handled);
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ static int ddb_probe(struct pci_dev *pdev,
|
||||
ddb_unmap(dev);
|
||||
pci_set_drvdata(pdev, NULL);
|
||||
pci_disable_device(pdev);
|
||||
return -1;
|
||||
return stat;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@@ -195,25 +195,16 @@ static int rga_setup_ctrls(struct rga_ctx *ctx)
|
||||
static struct rga_fmt formats[] = {
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_ARGB32,
|
||||
.color_swap = RGA_COLOR_RB_SWAP,
|
||||
.color_swap = RGA_COLOR_ALPHA_SWAP,
|
||||
.hw_format = RGA_COLOR_FMT_ABGR8888,
|
||||
.depth = 32,
|
||||
.uv_factor = 1,
|
||||
.y_div = 1,
|
||||
.x_div = 1,
|
||||
},
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_XRGB32,
|
||||
.color_swap = RGA_COLOR_RB_SWAP,
|
||||
.hw_format = RGA_COLOR_FMT_XBGR8888,
|
||||
.depth = 32,
|
||||
.uv_factor = 1,
|
||||
.y_div = 1,
|
||||
.x_div = 1,
|
||||
},
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_ABGR32,
|
||||
.color_swap = RGA_COLOR_ALPHA_SWAP,
|
||||
.color_swap = RGA_COLOR_RB_SWAP,
|
||||
.hw_format = RGA_COLOR_FMT_ABGR8888,
|
||||
.depth = 32,
|
||||
.uv_factor = 1,
|
||||
@@ -222,7 +213,7 @@ static struct rga_fmt formats[] = {
|
||||
},
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_XBGR32,
|
||||
.color_swap = RGA_COLOR_ALPHA_SWAP,
|
||||
.color_swap = RGA_COLOR_RB_SWAP,
|
||||
.hw_format = RGA_COLOR_FMT_XBGR8888,
|
||||
.depth = 32,
|
||||
.uv_factor = 1,
|
||||
|
||||
@@ -117,8 +117,7 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len)
|
||||
|
||||
/*
|
||||
* TODO: These stk1160_dbg are very spammy!
|
||||
* We should 1) check why we are getting them
|
||||
* and 2) add ratelimit.
|
||||
* We should check why we are getting them.
|
||||
*
|
||||
* UPDATE: One of the reasons (the only one?) for getting these
|
||||
* is incorrect standard (mismatch between expected and configured).
|
||||
@@ -161,7 +160,7 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len)
|
||||
|
||||
/* Let the bug hunt begin! sanity checks! */
|
||||
if (lencopy < 0) {
|
||||
stk1160_dbg("copy skipped: negative lencopy\n");
|
||||
printk_ratelimited(KERN_DEBUG "copy skipped: negative lencopy\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1247,6 +1247,7 @@ config MFD_DAVINCI_VOICECODEC
|
||||
|
||||
config MFD_TI_AM335X_TSCADC
|
||||
tristate "TI ADC / Touch Screen chip support"
|
||||
depends on ARCH_OMAP2PLUS || ARCH_K3 || COMPILE_TEST
|
||||
select MFD_CORE
|
||||
select REGMAP
|
||||
select REGMAP_MMIO
|
||||
|
||||
@@ -984,7 +984,8 @@ static int alb_upper_dev_walk(struct net_device *upper, void *_data)
|
||||
if (netif_is_macvlan(upper) && !strict_match) {
|
||||
tags = bond_verify_device_path(bond->dev, upper, 0);
|
||||
if (IS_ERR_OR_NULL(tags))
|
||||
BUG();
|
||||
return -ENOMEM;
|
||||
|
||||
alb_send_lp_vid(slave, upper->dev_addr,
|
||||
tags[0].vlan_proto, tags[0].vlan_id);
|
||||
kfree(tags);
|
||||
|
||||
@@ -823,7 +823,6 @@ int aq_nic_set_link_ksettings(struct aq_nic_s *self,
|
||||
default:
|
||||
err = -1;
|
||||
goto err_exit;
|
||||
break;
|
||||
}
|
||||
if (!(self->aq_nic_cfg.aq_hw_caps->link_speed_msk & rate)) {
|
||||
err = -1;
|
||||
|
||||
@@ -454,7 +454,6 @@ static int enic_grxclsrule(struct enic *enic, struct ethtool_rxnfc *cmd)
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
fsp->h_u.tcp_ip4_spec.ip4src = flow_get_u32_src(&n->keys);
|
||||
|
||||
@@ -1798,6 +1798,7 @@ static void fec_enet_adjust_link(struct net_device *ndev)
|
||||
|
||||
/* if any of the above changed restart the FEC */
|
||||
if (status_change) {
|
||||
netif_stop_queue(ndev);
|
||||
napi_disable(&fep->napi);
|
||||
netif_tx_lock_bh(ndev);
|
||||
fec_restart(ndev);
|
||||
@@ -1807,6 +1808,7 @@ static void fec_enet_adjust_link(struct net_device *ndev)
|
||||
}
|
||||
} else {
|
||||
if (fep->link) {
|
||||
netif_stop_queue(ndev);
|
||||
napi_disable(&fep->napi);
|
||||
netif_tx_lock_bh(ndev);
|
||||
fec_stop(ndev);
|
||||
|
||||
@@ -4966,7 +4966,7 @@ static int i40e_pf_wait_queues_disabled(struct i40e_pf *pf)
|
||||
{
|
||||
int v, ret = 0;
|
||||
|
||||
for (v = 0; v < pf->hw.func_caps.num_vsis; v++) {
|
||||
for (v = 0; v < pf->num_alloc_vsi; v++) {
|
||||
if (pf->vsi[v]) {
|
||||
ret = i40e_vsi_wait_queues_disabled(pf->vsi[v]);
|
||||
if (ret)
|
||||
|
||||
@@ -123,14 +123,14 @@ static s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
if (hw->phy.sfp_type == ixgbe_sfp_type_unknown)
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/* Check to see if SFP+ module is supported */
|
||||
ret_val = ixgbe_get_sfp_init_sequence_offsets(hw,
|
||||
&list_offset,
|
||||
&data_offset);
|
||||
if (ret_val)
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -213,7 +213,7 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw,
|
||||
break;
|
||||
|
||||
default:
|
||||
return IXGBE_ERR_LINK_SETUP;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -283,7 +283,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw)
|
||||
|
||||
/* Validate the water mark configuration */
|
||||
if (!hw->fc.pause_time)
|
||||
return IXGBE_ERR_INVALID_LINK_SETTINGS;
|
||||
return -EINVAL;
|
||||
|
||||
/* Low water mark of zero causes XOFF floods */
|
||||
for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
|
||||
@@ -292,7 +292,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw)
|
||||
if (!hw->fc.low_water[i] ||
|
||||
hw->fc.low_water[i] >= hw->fc.high_water[i]) {
|
||||
hw_dbg(hw, "Invalid water mark configuration\n");
|
||||
return IXGBE_ERR_INVALID_LINK_SETTINGS;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -369,7 +369,7 @@ static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw)
|
||||
break;
|
||||
default:
|
||||
hw_dbg(hw, "Flow control param set incorrectly\n");
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Set 802.3x based flow control settings. */
|
||||
@@ -438,7 +438,7 @@ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw,
|
||||
msleep(100);
|
||||
}
|
||||
if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
|
||||
status = IXGBE_ERR_AUTONEG_NOT_COMPLETE;
|
||||
status = -EIO;
|
||||
hw_dbg(hw, "Autonegotiation did not complete.\n");
|
||||
}
|
||||
}
|
||||
@@ -478,7 +478,7 @@ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw)
|
||||
|
||||
if (timeout == IXGBE_VALIDATE_LINK_READY_TIMEOUT) {
|
||||
hw_dbg(hw, "Link was indicated but link is down\n");
|
||||
return IXGBE_ERR_LINK_SETUP;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -594,7 +594,7 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw,
|
||||
speed &= link_capabilities;
|
||||
|
||||
if (speed == IXGBE_LINK_SPEED_UNKNOWN)
|
||||
return IXGBE_ERR_LINK_SETUP;
|
||||
return -EINVAL;
|
||||
|
||||
/* Set KX4/KX support according to speed requested */
|
||||
else if (link_mode == IXGBE_AUTOC_LMS_KX4_AN ||
|
||||
@@ -701,9 +701,9 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
|
||||
|
||||
/* Init PHY and function pointers, perform SFP setup */
|
||||
phy_status = hw->phy.ops.init(hw);
|
||||
if (phy_status == IXGBE_ERR_SFP_NOT_SUPPORTED)
|
||||
if (phy_status == -EOPNOTSUPP)
|
||||
return phy_status;
|
||||
if (phy_status == IXGBE_ERR_SFP_NOT_PRESENT)
|
||||
if (phy_status == -ENOENT)
|
||||
goto mac_reset_top;
|
||||
|
||||
hw->phy.ops.reset(hw);
|
||||
@@ -727,7 +727,7 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
|
||||
udelay(1);
|
||||
}
|
||||
if (ctrl & IXGBE_CTRL_RST) {
|
||||
status = IXGBE_ERR_RESET_FAILED;
|
||||
status = -EIO;
|
||||
hw_dbg(hw, "Reset polling failed to complete.\n");
|
||||
}
|
||||
|
||||
@@ -789,7 +789,7 @@ static s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
|
||||
/* Make sure we are using a valid rar index range */
|
||||
if (rar >= rar_entries) {
|
||||
hw_dbg(hw, "RAR index %d is out of range.\n", rar);
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(rar));
|
||||
@@ -814,7 +814,7 @@ static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
|
||||
/* Make sure we are using a valid rar index range */
|
||||
if (rar >= rar_entries) {
|
||||
hw_dbg(hw, "RAR index %d is out of range.\n", rar);
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(rar));
|
||||
@@ -845,7 +845,7 @@ static s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind,
|
||||
u32 vftabyte;
|
||||
|
||||
if (vlan > 4095)
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
|
||||
/* Determine 32-bit word position in array */
|
||||
regindex = (vlan >> 5) & 0x7F; /* upper seven bits */
|
||||
@@ -964,7 +964,7 @@ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr,
|
||||
gssr = IXGBE_GSSR_PHY0_SM;
|
||||
|
||||
if (hw->mac.ops.acquire_swfw_sync(hw, gssr) != 0)
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
if (hw->phy.type == ixgbe_phy_nl) {
|
||||
/*
|
||||
@@ -993,7 +993,7 @@ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr,
|
||||
|
||||
if (sfp_stat != IXGBE_I2C_EEPROM_STATUS_PASS) {
|
||||
hw_dbg(hw, "EEPROM read did not pass.\n");
|
||||
status = IXGBE_ERR_SFP_NOT_PRESENT;
|
||||
status = -ENOENT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1003,7 +1003,7 @@ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr,
|
||||
|
||||
*eeprom_data = (u8)(sfp_data >> 8);
|
||||
} else {
|
||||
status = IXGBE_ERR_PHY;
|
||||
status = -EIO;
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
@@ -117,7 +117,7 @@ static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
|
||||
ret_val = hw->mac.ops.acquire_swfw_sync(hw,
|
||||
IXGBE_GSSR_MAC_CSR_SM);
|
||||
if (ret_val)
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
if (hw->eeprom.ops.read(hw, ++data_offset, &data_value))
|
||||
goto setup_sfp_err;
|
||||
@@ -144,7 +144,7 @@ static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
|
||||
|
||||
if (ret_val) {
|
||||
hw_dbg(hw, " sfp module setup not complete\n");
|
||||
return IXGBE_ERR_SFP_SETUP_NOT_COMPLETE;
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
|
||||
usleep_range(hw->eeprom.semaphore_delay * 1000,
|
||||
hw->eeprom.semaphore_delay * 2000);
|
||||
hw_err(hw, "eeprom read at offset %d failed\n", data_offset);
|
||||
return IXGBE_ERR_SFP_SETUP_NOT_COMPLETE;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,7 +184,7 @@ static s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked,
|
||||
ret_val = hw->mac.ops.acquire_swfw_sync(hw,
|
||||
IXGBE_GSSR_MAC_CSR_SM);
|
||||
if (ret_val)
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
*locked = true;
|
||||
}
|
||||
@@ -219,7 +219,7 @@ static s32 prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked)
|
||||
ret_val = hw->mac.ops.acquire_swfw_sync(hw,
|
||||
IXGBE_GSSR_MAC_CSR_SM);
|
||||
if (ret_val)
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
locked = true;
|
||||
}
|
||||
@@ -400,7 +400,7 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
|
||||
break;
|
||||
|
||||
default:
|
||||
return IXGBE_ERR_LINK_SETUP;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (hw->phy.multispeed_fiber) {
|
||||
@@ -541,7 +541,7 @@ static s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw,
|
||||
msleep(100);
|
||||
}
|
||||
if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
|
||||
status = IXGBE_ERR_AUTONEG_NOT_COMPLETE;
|
||||
status = -EIO;
|
||||
hw_dbg(hw, "Autoneg did not complete.\n");
|
||||
}
|
||||
}
|
||||
@@ -794,7 +794,7 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
|
||||
speed &= link_capabilities;
|
||||
|
||||
if (speed == IXGBE_LINK_SPEED_UNKNOWN)
|
||||
return IXGBE_ERR_LINK_SETUP;
|
||||
return -EINVAL;
|
||||
|
||||
/* Use stored value (EEPROM defaults) of AUTOC to find KR/KX4 support*/
|
||||
if (hw->mac.orig_link_settings_stored)
|
||||
@@ -861,8 +861,7 @@ static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
|
||||
msleep(100);
|
||||
}
|
||||
if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
|
||||
status =
|
||||
IXGBE_ERR_AUTONEG_NOT_COMPLETE;
|
||||
status = -EIO;
|
||||
hw_dbg(hw, "Autoneg did not complete.\n");
|
||||
}
|
||||
}
|
||||
@@ -927,7 +926,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
|
||||
/* Identify PHY and related function pointers */
|
||||
status = hw->phy.ops.init(hw);
|
||||
|
||||
if (status == IXGBE_ERR_SFP_NOT_SUPPORTED)
|
||||
if (status == -EOPNOTSUPP)
|
||||
return status;
|
||||
|
||||
/* Setup SFP module if there is one present. */
|
||||
@@ -936,7 +935,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
|
||||
hw->phy.sfp_setup_needed = false;
|
||||
}
|
||||
|
||||
if (status == IXGBE_ERR_SFP_NOT_SUPPORTED)
|
||||
if (status == -EOPNOTSUPP)
|
||||
return status;
|
||||
|
||||
/* Reset PHY */
|
||||
@@ -974,7 +973,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
|
||||
}
|
||||
|
||||
if (ctrl & IXGBE_CTRL_RST_MASK) {
|
||||
status = IXGBE_ERR_RESET_FAILED;
|
||||
status = -EIO;
|
||||
hw_dbg(hw, "Reset polling failed to complete.\n");
|
||||
}
|
||||
|
||||
@@ -1093,7 +1092,7 @@ static s32 ixgbe_fdir_check_cmd_complete(struct ixgbe_hw *hw, u32 *fdircmd)
|
||||
udelay(10);
|
||||
}
|
||||
|
||||
return IXGBE_ERR_FDIR_CMD_INCOMPLETE;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1155,7 +1154,7 @@ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw)
|
||||
}
|
||||
if (i >= IXGBE_FDIR_INIT_DONE_POLL) {
|
||||
hw_dbg(hw, "Flow Director Signature poll time exceeded!\n");
|
||||
return IXGBE_ERR_FDIR_REINIT_FAILED;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Clear FDIR statistics registers (read to clear) */
|
||||
@@ -1387,7 +1386,7 @@ s32 ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
|
||||
break;
|
||||
default:
|
||||
hw_dbg(hw, " Error on flow type input\n");
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* configure FDIRCMD register */
|
||||
@@ -1546,7 +1545,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
|
||||
break;
|
||||
default:
|
||||
hw_dbg(hw, " Error on vm pool mask\n");
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
switch (input_mask->formatted.flow_type & IXGBE_ATR_L4TYPE_MASK) {
|
||||
@@ -1555,13 +1554,13 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
|
||||
if (input_mask->formatted.dst_port ||
|
||||
input_mask->formatted.src_port) {
|
||||
hw_dbg(hw, " Error on src/dst port mask\n");
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
}
|
||||
case IXGBE_ATR_L4TYPE_MASK:
|
||||
break;
|
||||
default:
|
||||
hw_dbg(hw, " Error on flow type mask\n");
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
switch (ntohs(input_mask->formatted.vlan_id) & 0xEFFF) {
|
||||
@@ -1582,7 +1581,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
|
||||
break;
|
||||
default:
|
||||
hw_dbg(hw, " Error on VLAN mask\n");
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
switch ((__force u16)input_mask->formatted.flex_bytes & 0xFFFF) {
|
||||
@@ -1594,7 +1593,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
|
||||
break;
|
||||
default:
|
||||
hw_dbg(hw, " Error on flexible byte mask\n");
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Now mask VM pool and destination IPv6 - bits 5 and 2 */
|
||||
@@ -1823,7 +1822,7 @@ static s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw)
|
||||
|
||||
/* Return error if SFP module has been detected but is not supported */
|
||||
if (hw->phy.type == ixgbe_phy_sfp_unsupported)
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -1862,13 +1861,13 @@ static s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval)
|
||||
* Verifies that installed the firmware version is 0.6 or higher
|
||||
* for SFI devices. All 82599 SFI devices should have version 0.6 or higher.
|
||||
*
|
||||
* Returns IXGBE_ERR_EEPROM_VERSION if the FW is not present or
|
||||
* if the FW version is not supported.
|
||||
* Return: -EACCES if the FW is not present or if the FW version is
|
||||
* not supported.
|
||||
**/
|
||||
static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw)
|
||||
{
|
||||
s32 status = IXGBE_ERR_EEPROM_VERSION;
|
||||
u16 fw_offset, fw_ptp_cfg_offset;
|
||||
s32 status = -EACCES;
|
||||
u16 offset;
|
||||
u16 fw_version = 0;
|
||||
|
||||
@@ -1882,7 +1881,7 @@ static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw)
|
||||
goto fw_version_err;
|
||||
|
||||
if (fw_offset == 0 || fw_offset == 0xFFFF)
|
||||
return IXGBE_ERR_EEPROM_VERSION;
|
||||
return -EACCES;
|
||||
|
||||
/* get the offset to the Pass Through Patch Configuration block */
|
||||
offset = fw_offset + IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR;
|
||||
@@ -1890,7 +1889,7 @@ static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw)
|
||||
goto fw_version_err;
|
||||
|
||||
if (fw_ptp_cfg_offset == 0 || fw_ptp_cfg_offset == 0xFFFF)
|
||||
return IXGBE_ERR_EEPROM_VERSION;
|
||||
return -EACCES;
|
||||
|
||||
/* get the firmware version */
|
||||
offset = fw_ptp_cfg_offset + IXGBE_FW_PATCH_VERSION_4;
|
||||
@@ -1904,7 +1903,7 @@ static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw)
|
||||
|
||||
fw_version_err:
|
||||
hw_err(hw, "eeprom read at offset %d failed\n", offset);
|
||||
return IXGBE_ERR_EEPROM_VERSION;
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2037,7 +2036,7 @@ static s32 ixgbe_reset_pipeline_82599(struct ixgbe_hw *hw)
|
||||
|
||||
if (!(anlp1_reg & IXGBE_ANLP1_AN_STATE_MASK)) {
|
||||
hw_dbg(hw, "auto negotiation not completed\n");
|
||||
ret_val = IXGBE_ERR_RESET_FAILED;
|
||||
ret_val = -EIO;
|
||||
goto reset_pipeline_out;
|
||||
}
|
||||
|
||||
@@ -2086,7 +2085,7 @@ static s32 ixgbe_read_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset,
|
||||
|
||||
if (!timeout) {
|
||||
hw_dbg(hw, "Driver can't access resource, acquiring I2C bus timeout.\n");
|
||||
status = IXGBE_ERR_I2C;
|
||||
status = -EIO;
|
||||
goto release_i2c_access;
|
||||
}
|
||||
}
|
||||
@@ -2140,7 +2139,7 @@ static s32 ixgbe_write_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset,
|
||||
|
||||
if (!timeout) {
|
||||
hw_dbg(hw, "Driver can't access resource, acquiring I2C bus timeout.\n");
|
||||
status = IXGBE_ERR_I2C;
|
||||
status = -EIO;
|
||||
goto release_i2c_access;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ static s32 ixgbe_write_eeprom_buffer_bit_bang(struct ixgbe_hw *hw, u16 offset,
|
||||
u16 words, u16 *data);
|
||||
static s32 ixgbe_detect_eeprom_page_size_generic(struct ixgbe_hw *hw,
|
||||
u16 offset);
|
||||
static s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw);
|
||||
static s32 ixgbe_disable_pcie_primary(struct ixgbe_hw *hw);
|
||||
|
||||
/* Base table for registers values that change by MAC */
|
||||
const u32 ixgbe_mvals_8259X[IXGBE_MVALS_IDX_LIMIT] = {
|
||||
@@ -124,7 +124,7 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw)
|
||||
*/
|
||||
if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
|
||||
hw_dbg(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n");
|
||||
return IXGBE_ERR_INVALID_LINK_SETTINGS;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -215,7 +215,7 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw)
|
||||
break;
|
||||
default:
|
||||
hw_dbg(hw, "Flow control param set incorrectly\n");
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (hw->mac.type != ixgbe_mac_X540) {
|
||||
@@ -500,7 +500,7 @@ s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num,
|
||||
|
||||
if (pba_num == NULL) {
|
||||
hw_dbg(hw, "PBA string buffer was null\n");
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM0_PTR, &data);
|
||||
@@ -526,7 +526,7 @@ s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num,
|
||||
/* we will need 11 characters to store the PBA */
|
||||
if (pba_num_size < 11) {
|
||||
hw_dbg(hw, "PBA string buffer too small\n");
|
||||
return IXGBE_ERR_NO_SPACE;
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
/* extract hex string from data and pba_ptr */
|
||||
@@ -563,13 +563,13 @@ s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num,
|
||||
|
||||
if (length == 0xFFFF || length == 0) {
|
||||
hw_dbg(hw, "NVM PBA number section invalid length\n");
|
||||
return IXGBE_ERR_PBA_SECTION;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* check if pba_num buffer is big enough */
|
||||
if (pba_num_size < (((u32)length * 2) - 1)) {
|
||||
hw_dbg(hw, "PBA string buffer too small\n");
|
||||
return IXGBE_ERR_NO_SPACE;
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
/* trim pba length from start of string */
|
||||
@@ -746,10 +746,10 @@ s32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw)
|
||||
usleep_range(1000, 2000);
|
||||
|
||||
/*
|
||||
* Prevent the PCI-E bus from from hanging by disabling PCI-E master
|
||||
* Prevent the PCI-E bus from hanging by disabling PCI-E primary
|
||||
* access and verify no pending requests
|
||||
*/
|
||||
return ixgbe_disable_pcie_master(hw);
|
||||
return ixgbe_disable_pcie_primary(hw);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -805,7 +805,7 @@ s32 ixgbe_led_on_generic(struct ixgbe_hw *hw, u32 index)
|
||||
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
||||
|
||||
if (index > 3)
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
|
||||
/* To turn on the LED, set mode to ON. */
|
||||
led_reg &= ~IXGBE_LED_MODE_MASK(index);
|
||||
@@ -826,7 +826,7 @@ s32 ixgbe_led_off_generic(struct ixgbe_hw *hw, u32 index)
|
||||
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
||||
|
||||
if (index > 3)
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
|
||||
/* To turn off the LED, set mode to OFF. */
|
||||
led_reg &= ~IXGBE_LED_MODE_MASK(index);
|
||||
@@ -904,11 +904,8 @@ s32 ixgbe_write_eeprom_buffer_bit_bang_generic(struct ixgbe_hw *hw, u16 offset,
|
||||
|
||||
hw->eeprom.ops.init_params(hw);
|
||||
|
||||
if (words == 0)
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
|
||||
if (offset + words > hw->eeprom.word_size)
|
||||
return IXGBE_ERR_EEPROM;
|
||||
if (words == 0 || (offset + words > hw->eeprom.word_size))
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* The EEPROM page size cannot be queried from the chip. We do lazy
|
||||
@@ -962,7 +959,7 @@ static s32 ixgbe_write_eeprom_buffer_bit_bang(struct ixgbe_hw *hw, u16 offset,
|
||||
|
||||
if (ixgbe_ready_eeprom(hw) != 0) {
|
||||
ixgbe_release_eeprom(hw);
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
for (i = 0; i < words; i++) {
|
||||
@@ -1028,7 +1025,7 @@ s32 ixgbe_write_eeprom_generic(struct ixgbe_hw *hw, u16 offset, u16 data)
|
||||
hw->eeprom.ops.init_params(hw);
|
||||
|
||||
if (offset >= hw->eeprom.word_size)
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EINVAL;
|
||||
|
||||
return ixgbe_write_eeprom_buffer_bit_bang(hw, offset, 1, &data);
|
||||
}
|
||||
@@ -1050,11 +1047,8 @@ s32 ixgbe_read_eeprom_buffer_bit_bang_generic(struct ixgbe_hw *hw, u16 offset,
|
||||
|
||||
hw->eeprom.ops.init_params(hw);
|
||||
|
||||
if (words == 0)
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
|
||||
if (offset + words > hw->eeprom.word_size)
|
||||
return IXGBE_ERR_EEPROM;
|
||||
if (words == 0 || (offset + words > hw->eeprom.word_size))
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* We cannot hold synchronization semaphores for too long
|
||||
@@ -1099,7 +1093,7 @@ static s32 ixgbe_read_eeprom_buffer_bit_bang(struct ixgbe_hw *hw, u16 offset,
|
||||
|
||||
if (ixgbe_ready_eeprom(hw) != 0) {
|
||||
ixgbe_release_eeprom(hw);
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
for (i = 0; i < words; i++) {
|
||||
@@ -1142,7 +1136,7 @@ s32 ixgbe_read_eeprom_bit_bang_generic(struct ixgbe_hw *hw, u16 offset,
|
||||
hw->eeprom.ops.init_params(hw);
|
||||
|
||||
if (offset >= hw->eeprom.word_size)
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EINVAL;
|
||||
|
||||
return ixgbe_read_eeprom_buffer_bit_bang(hw, offset, 1, data);
|
||||
}
|
||||
@@ -1165,11 +1159,8 @@ s32 ixgbe_read_eerd_buffer_generic(struct ixgbe_hw *hw, u16 offset,
|
||||
|
||||
hw->eeprom.ops.init_params(hw);
|
||||
|
||||
if (words == 0)
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
|
||||
if (offset >= hw->eeprom.word_size)
|
||||
return IXGBE_ERR_EEPROM;
|
||||
if (words == 0 || offset >= hw->eeprom.word_size)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < words; i++) {
|
||||
eerd = ((offset + i) << IXGBE_EEPROM_RW_ADDR_SHIFT) |
|
||||
@@ -1262,11 +1253,8 @@ s32 ixgbe_write_eewr_buffer_generic(struct ixgbe_hw *hw, u16 offset,
|
||||
|
||||
hw->eeprom.ops.init_params(hw);
|
||||
|
||||
if (words == 0)
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
|
||||
if (offset >= hw->eeprom.word_size)
|
||||
return IXGBE_ERR_EEPROM;
|
||||
if (words == 0 || offset >= hw->eeprom.word_size)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < words; i++) {
|
||||
eewr = ((offset + i) << IXGBE_EEPROM_RW_ADDR_SHIFT) |
|
||||
@@ -1328,7 +1316,7 @@ static s32 ixgbe_poll_eerd_eewr_done(struct ixgbe_hw *hw, u32 ee_reg)
|
||||
}
|
||||
udelay(5);
|
||||
}
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1344,7 +1332,7 @@ static s32 ixgbe_acquire_eeprom(struct ixgbe_hw *hw)
|
||||
u32 i;
|
||||
|
||||
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) != 0)
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
eec = IXGBE_READ_REG(hw, IXGBE_EEC(hw));
|
||||
|
||||
@@ -1366,7 +1354,7 @@ static s32 ixgbe_acquire_eeprom(struct ixgbe_hw *hw)
|
||||
hw_dbg(hw, "Could not acquire EEPROM grant\n");
|
||||
|
||||
hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Setup EEPROM for Read/Write */
|
||||
@@ -1419,7 +1407,7 @@ static s32 ixgbe_get_eeprom_semaphore(struct ixgbe_hw *hw)
|
||||
swsm = IXGBE_READ_REG(hw, IXGBE_SWSM(hw));
|
||||
if (swsm & IXGBE_SWSM_SMBI) {
|
||||
hw_dbg(hw, "Software semaphore SMBI between device drivers not granted.\n");
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1447,7 +1435,7 @@ static s32 ixgbe_get_eeprom_semaphore(struct ixgbe_hw *hw)
|
||||
if (i >= timeout) {
|
||||
hw_dbg(hw, "SWESMBI Software EEPROM semaphore not granted.\n");
|
||||
ixgbe_release_eeprom_semaphore(hw);
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1503,7 +1491,7 @@ static s32 ixgbe_ready_eeprom(struct ixgbe_hw *hw)
|
||||
*/
|
||||
if (i >= IXGBE_EEPROM_MAX_RETRY_SPI) {
|
||||
hw_dbg(hw, "SPI EEPROM Status error\n");
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1715,7 +1703,7 @@ s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw)
|
||||
for (i = IXGBE_PCIE_ANALOG_PTR; i < IXGBE_FW_PTR; i++) {
|
||||
if (hw->eeprom.ops.read(hw, i, &pointer)) {
|
||||
hw_dbg(hw, "EEPROM read failed\n");
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* If the pointer seems invalid */
|
||||
@@ -1724,7 +1712,7 @@ s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw)
|
||||
|
||||
if (hw->eeprom.ops.read(hw, pointer, &length)) {
|
||||
hw_dbg(hw, "EEPROM read failed\n");
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (length == 0xFFFF || length == 0)
|
||||
@@ -1733,7 +1721,7 @@ s32 ixgbe_calc_eeprom_checksum_generic(struct ixgbe_hw *hw)
|
||||
for (j = pointer + 1; j <= pointer + length; j++) {
|
||||
if (hw->eeprom.ops.read(hw, j, &word)) {
|
||||
hw_dbg(hw, "EEPROM read failed\n");
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
checksum += word;
|
||||
}
|
||||
@@ -1786,7 +1774,7 @@ s32 ixgbe_validate_eeprom_checksum_generic(struct ixgbe_hw *hw,
|
||||
* calculated checksum
|
||||
*/
|
||||
if (read_checksum != checksum)
|
||||
status = IXGBE_ERR_EEPROM_CHECKSUM;
|
||||
status = -EIO;
|
||||
|
||||
/* If the user cares, return the calculated checksum */
|
||||
if (checksum_val)
|
||||
@@ -1845,7 +1833,7 @@ s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
|
||||
/* Make sure we are using a valid rar index range */
|
||||
if (index >= rar_entries) {
|
||||
hw_dbg(hw, "RAR index %d is out of range.\n", index);
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* setup VMDq pool selection before this RAR gets enabled */
|
||||
@@ -1897,7 +1885,7 @@ s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index)
|
||||
/* Make sure we are using a valid rar index range */
|
||||
if (index >= rar_entries) {
|
||||
hw_dbg(hw, "RAR index %d is out of range.\n", index);
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2146,7 +2134,7 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw)
|
||||
|
||||
/* Validate the water mark configuration. */
|
||||
if (!hw->fc.pause_time)
|
||||
return IXGBE_ERR_INVALID_LINK_SETTINGS;
|
||||
return -EINVAL;
|
||||
|
||||
/* Low water mark of zero causes XOFF floods */
|
||||
for (i = 0; i < MAX_TRAFFIC_CLASS; i++) {
|
||||
@@ -2155,7 +2143,7 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw)
|
||||
if (!hw->fc.low_water[i] ||
|
||||
hw->fc.low_water[i] >= hw->fc.high_water[i]) {
|
||||
hw_dbg(hw, "Invalid water mark configuration\n");
|
||||
return IXGBE_ERR_INVALID_LINK_SETTINGS;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2212,7 +2200,7 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw)
|
||||
break;
|
||||
default:
|
||||
hw_dbg(hw, "Flow control param set incorrectly\n");
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Set 802.3x based flow control settings. */
|
||||
@@ -2269,7 +2257,7 @@ s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg,
|
||||
u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm)
|
||||
{
|
||||
if ((!(adv_reg)) || (!(lp_reg)))
|
||||
return IXGBE_ERR_FC_NOT_NEGOTIATED;
|
||||
return -EINVAL;
|
||||
|
||||
if ((adv_reg & adv_sym) && (lp_reg & lp_sym)) {
|
||||
/*
|
||||
@@ -2321,7 +2309,7 @@ static s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw)
|
||||
linkstat = IXGBE_READ_REG(hw, IXGBE_PCS1GLSTA);
|
||||
if ((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE) == 0) ||
|
||||
(!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT) == 1))
|
||||
return IXGBE_ERR_FC_NOT_NEGOTIATED;
|
||||
return -EIO;
|
||||
|
||||
pcs_anadv_reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANA);
|
||||
pcs_lpab_reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANLP);
|
||||
@@ -2353,12 +2341,12 @@ static s32 ixgbe_fc_autoneg_backplane(struct ixgbe_hw *hw)
|
||||
*/
|
||||
links = IXGBE_READ_REG(hw, IXGBE_LINKS);
|
||||
if ((links & IXGBE_LINKS_KX_AN_COMP) == 0)
|
||||
return IXGBE_ERR_FC_NOT_NEGOTIATED;
|
||||
return -EIO;
|
||||
|
||||
if (hw->mac.type == ixgbe_mac_82599EB) {
|
||||
links2 = IXGBE_READ_REG(hw, IXGBE_LINKS2);
|
||||
if ((links2 & IXGBE_LINKS2_AN_SUPPORTED) == 0)
|
||||
return IXGBE_ERR_FC_NOT_NEGOTIATED;
|
||||
return -EIO;
|
||||
}
|
||||
/*
|
||||
* Read the 10g AN autoc and LP ability registers and resolve
|
||||
@@ -2407,8 +2395,8 @@ static s32 ixgbe_fc_autoneg_copper(struct ixgbe_hw *hw)
|
||||
**/
|
||||
void ixgbe_fc_autoneg(struct ixgbe_hw *hw)
|
||||
{
|
||||
s32 ret_val = IXGBE_ERR_FC_NOT_NEGOTIATED;
|
||||
ixgbe_link_speed speed;
|
||||
s32 ret_val = -EIO;
|
||||
bool link_up;
|
||||
|
||||
/*
|
||||
@@ -2506,15 +2494,15 @@ static u32 ixgbe_pcie_timeout_poll(struct ixgbe_hw *hw)
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_disable_pcie_master - Disable PCI-express master access
|
||||
* ixgbe_disable_pcie_primary - Disable PCI-express primary access
|
||||
* @hw: pointer to hardware structure
|
||||
*
|
||||
* Disables PCI-Express master access and verifies there are no pending
|
||||
* requests. IXGBE_ERR_MASTER_REQUESTS_PENDING is returned if master disable
|
||||
* bit hasn't caused the master requests to be disabled, else 0
|
||||
* is returned signifying master requests disabled.
|
||||
* Disables PCI-Express primary access and verifies there are no pending
|
||||
* requests. -EALREADY is returned if primary disable
|
||||
* bit hasn't caused the primary requests to be disabled, else 0
|
||||
* is returned signifying primary requests disabled.
|
||||
**/
|
||||
static s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw)
|
||||
static s32 ixgbe_disable_pcie_primary(struct ixgbe_hw *hw)
|
||||
{
|
||||
u32 i, poll;
|
||||
u16 value;
|
||||
@@ -2523,23 +2511,23 @@ static s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw)
|
||||
IXGBE_WRITE_REG(hw, IXGBE_CTRL, IXGBE_CTRL_GIO_DIS);
|
||||
|
||||
/* Poll for bit to read as set */
|
||||
for (i = 0; i < IXGBE_PCI_MASTER_DISABLE_TIMEOUT; i++) {
|
||||
for (i = 0; i < IXGBE_PCI_PRIMARY_DISABLE_TIMEOUT; i++) {
|
||||
if (IXGBE_READ_REG(hw, IXGBE_CTRL) & IXGBE_CTRL_GIO_DIS)
|
||||
break;
|
||||
usleep_range(100, 120);
|
||||
}
|
||||
if (i >= IXGBE_PCI_MASTER_DISABLE_TIMEOUT) {
|
||||
if (i >= IXGBE_PCI_PRIMARY_DISABLE_TIMEOUT) {
|
||||
hw_dbg(hw, "GIO disable did not set - requesting resets\n");
|
||||
goto gio_disable_fail;
|
||||
}
|
||||
|
||||
/* Exit if master requests are blocked */
|
||||
/* Exit if primary requests are blocked */
|
||||
if (!(IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_GIO) ||
|
||||
ixgbe_removed(hw->hw_addr))
|
||||
return 0;
|
||||
|
||||
/* Poll for master request bit to clear */
|
||||
for (i = 0; i < IXGBE_PCI_MASTER_DISABLE_TIMEOUT; i++) {
|
||||
/* Poll for primary request bit to clear */
|
||||
for (i = 0; i < IXGBE_PCI_PRIMARY_DISABLE_TIMEOUT; i++) {
|
||||
udelay(100);
|
||||
if (!(IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_GIO))
|
||||
return 0;
|
||||
@@ -2547,13 +2535,13 @@ static s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw)
|
||||
|
||||
/*
|
||||
* Two consecutive resets are required via CTRL.RST per datasheet
|
||||
* 5.2.5.3.2 Master Disable. We set a flag to inform the reset routine
|
||||
* of this need. The first reset prevents new master requests from
|
||||
* 5.2.5.3.2 Primary Disable. We set a flag to inform the reset routine
|
||||
* of this need. The first reset prevents new primary requests from
|
||||
* being issued by our device. We then must wait 1usec or more for any
|
||||
* remaining completions from the PCIe bus to trickle in, and then reset
|
||||
* again to clear out any effects they may have had on our device.
|
||||
*/
|
||||
hw_dbg(hw, "GIO Master Disable bit didn't clear - requesting resets\n");
|
||||
hw_dbg(hw, "GIO Primary Disable bit didn't clear - requesting resets\n");
|
||||
gio_disable_fail:
|
||||
hw->mac.flags |= IXGBE_FLAGS_DOUBLE_RESET_REQUIRED;
|
||||
|
||||
@@ -2575,7 +2563,7 @@ static s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw)
|
||||
}
|
||||
|
||||
hw_dbg(hw, "PCIe transaction pending bit also did not clear.\n");
|
||||
return IXGBE_ERR_MASTER_REQUESTS_PENDING;
|
||||
return -EALREADY;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2600,7 +2588,7 @@ s32 ixgbe_acquire_swfw_sync(struct ixgbe_hw *hw, u32 mask)
|
||||
* SW_FW_SYNC bits (not just NVM)
|
||||
*/
|
||||
if (ixgbe_get_eeprom_semaphore(hw))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
gssr = IXGBE_READ_REG(hw, IXGBE_GSSR);
|
||||
if (!(gssr & (fwmask | swmask))) {
|
||||
@@ -2620,7 +2608,7 @@ s32 ixgbe_acquire_swfw_sync(struct ixgbe_hw *hw, u32 mask)
|
||||
ixgbe_release_swfw_sync(hw, gssr & (fwmask | swmask));
|
||||
|
||||
usleep_range(5000, 10000);
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2757,7 +2745,7 @@ s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index)
|
||||
s32 ret_val;
|
||||
|
||||
if (index > 3)
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* Link must be up to auto-blink the LEDs;
|
||||
@@ -2803,7 +2791,7 @@ s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index)
|
||||
s32 ret_val;
|
||||
|
||||
if (index > 3)
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
|
||||
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg);
|
||||
if (ret_val)
|
||||
@@ -2963,7 +2951,7 @@ s32 ixgbe_clear_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
|
||||
/* Make sure we are using a valid rar index range */
|
||||
if (rar >= rar_entries) {
|
||||
hw_dbg(hw, "RAR index %d is out of range.\n", rar);
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mpsar_lo = IXGBE_READ_REG(hw, IXGBE_MPSAR_LO(rar));
|
||||
@@ -3014,7 +3002,7 @@ s32 ixgbe_set_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
|
||||
/* Make sure we are using a valid rar index range */
|
||||
if (rar >= rar_entries) {
|
||||
hw_dbg(hw, "RAR index %d is out of range.\n", rar);
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (vmdq < 32) {
|
||||
@@ -3091,7 +3079,7 @@ static s32 ixgbe_find_vlvf_slot(struct ixgbe_hw *hw, u32 vlan, bool vlvf_bypass)
|
||||
* will simply bypass the VLVF if there are no entries present in the
|
||||
* VLVF that contain our VLAN
|
||||
*/
|
||||
first_empty_slot = vlvf_bypass ? IXGBE_ERR_NO_SPACE : 0;
|
||||
first_empty_slot = vlvf_bypass ? -ENOSPC : 0;
|
||||
|
||||
/* add VLAN enable bit for comparison */
|
||||
vlan |= IXGBE_VLVF_VIEN;
|
||||
@@ -3115,7 +3103,7 @@ static s32 ixgbe_find_vlvf_slot(struct ixgbe_hw *hw, u32 vlan, bool vlvf_bypass)
|
||||
if (!first_empty_slot)
|
||||
hw_dbg(hw, "No space in VLVF.\n");
|
||||
|
||||
return first_empty_slot ? : IXGBE_ERR_NO_SPACE;
|
||||
return first_empty_slot ? : -ENOSPC;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3135,7 +3123,7 @@ s32 ixgbe_set_vfta_generic(struct ixgbe_hw *hw, u32 vlan, u32 vind,
|
||||
s32 vlvf_index;
|
||||
|
||||
if ((vlan > 4095) || (vind > 63))
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* this is a 2 part operation - first the VFTA, then the
|
||||
@@ -3596,7 +3584,8 @@ u8 ixgbe_calculate_checksum(u8 *buffer, u32 length)
|
||||
*
|
||||
* Communicates with the manageability block. On success return 0
|
||||
* else returns semaphore error when encountering an error acquiring
|
||||
* semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails.
|
||||
* semaphore, -EINVAL when incorrect parameters passed or -EIO when
|
||||
* command fails.
|
||||
*
|
||||
* This function assumes that the IXGBE_GSSR_SW_MNG_SM semaphore is held
|
||||
* by the caller.
|
||||
@@ -3609,7 +3598,7 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length,
|
||||
|
||||
if (!length || length > IXGBE_HI_MAX_BLOCK_BYTE_LENGTH) {
|
||||
hw_dbg(hw, "Buffer length failure buffersize-%d.\n", length);
|
||||
return IXGBE_ERR_HOST_INTERFACE_COMMAND;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Set bit 9 of FWSTS clearing FW reset indication */
|
||||
@@ -3620,13 +3609,13 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length,
|
||||
hicr = IXGBE_READ_REG(hw, IXGBE_HICR);
|
||||
if (!(hicr & IXGBE_HICR_EN)) {
|
||||
hw_dbg(hw, "IXGBE_HOST_EN bit disabled.\n");
|
||||
return IXGBE_ERR_HOST_INTERFACE_COMMAND;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Calculate length in DWORDs. We must be DWORD aligned */
|
||||
if (length % sizeof(u32)) {
|
||||
hw_dbg(hw, "Buffer length failure, not aligned to dword");
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dword_len = length >> 2;
|
||||
@@ -3651,7 +3640,7 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length,
|
||||
/* Check command successful completion. */
|
||||
if ((timeout && i == timeout) ||
|
||||
!(IXGBE_READ_REG(hw, IXGBE_HICR) & IXGBE_HICR_SV))
|
||||
return IXGBE_ERR_HOST_INTERFACE_COMMAND;
|
||||
return -EIO;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -3671,7 +3660,7 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length,
|
||||
* in these cases.
|
||||
*
|
||||
* Communicates with the manageability block. On success return 0
|
||||
* else return IXGBE_ERR_HOST_INTERFACE_COMMAND.
|
||||
* else return -EIO or -EINVAL.
|
||||
**/
|
||||
s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,
|
||||
u32 length, u32 timeout,
|
||||
@@ -3688,7 +3677,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,
|
||||
|
||||
if (!length || length > IXGBE_HI_MAX_BLOCK_BYTE_LENGTH) {
|
||||
hw_dbg(hw, "Buffer length failure buffersize-%d.\n", length);
|
||||
return IXGBE_ERR_HOST_INTERFACE_COMMAND;
|
||||
return -EINVAL;
|
||||
}
|
||||
/* Take management host interface semaphore */
|
||||
status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM);
|
||||
@@ -3718,7 +3707,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,
|
||||
|
||||
if (length < round_up(buf_len, 4) + hdr_size) {
|
||||
hw_dbg(hw, "Buffer not large enough for reply message.\n");
|
||||
status = IXGBE_ERR_HOST_INTERFACE_COMMAND;
|
||||
status = -EIO;
|
||||
goto rel_out;
|
||||
}
|
||||
|
||||
@@ -3749,8 +3738,8 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,
|
||||
*
|
||||
* Sends driver version number to firmware through the manageability
|
||||
* block. On success return 0
|
||||
* else returns IXGBE_ERR_SWFW_SYNC when encountering an error acquiring
|
||||
* semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails.
|
||||
* else returns -EBUSY when encountering an error acquiring
|
||||
* semaphore or -EIO when command fails.
|
||||
**/
|
||||
s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,
|
||||
u8 build, u8 sub, __always_unused u16 len,
|
||||
@@ -3786,7 +3775,7 @@ s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,
|
||||
FW_CEM_RESP_STATUS_SUCCESS)
|
||||
ret_val = 0;
|
||||
else
|
||||
ret_val = IXGBE_ERR_HOST_INTERFACE_COMMAND;
|
||||
ret_val = -EIO;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -3884,14 +3873,14 @@ static s32 ixgbe_get_ets_data(struct ixgbe_hw *hw, u16 *ets_cfg,
|
||||
return status;
|
||||
|
||||
if ((*ets_offset == 0x0000) || (*ets_offset == 0xFFFF))
|
||||
return IXGBE_NOT_IMPLEMENTED;
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
status = hw->eeprom.ops.read(hw, *ets_offset, ets_cfg);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
if ((*ets_cfg & IXGBE_ETS_TYPE_MASK) != IXGBE_ETS_TYPE_EMC_SHIFTED)
|
||||
return IXGBE_NOT_IMPLEMENTED;
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -3914,7 +3903,7 @@ s32 ixgbe_get_thermal_sensor_data_generic(struct ixgbe_hw *hw)
|
||||
|
||||
/* Only support thermal sensors attached to physical port 0 */
|
||||
if ((IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1))
|
||||
return IXGBE_NOT_IMPLEMENTED;
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
status = ixgbe_get_ets_data(hw, &ets_cfg, &ets_offset);
|
||||
if (status)
|
||||
@@ -3974,7 +3963,7 @@ s32 ixgbe_init_thermal_sensor_thresh_generic(struct ixgbe_hw *hw)
|
||||
|
||||
/* Only support thermal sensors attached to physical port 0 */
|
||||
if ((IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1))
|
||||
return IXGBE_NOT_IMPLEMENTED;
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
status = ixgbe_get_ets_data(hw, &ets_cfg, &ets_offset);
|
||||
if (status)
|
||||
|
||||
@@ -3244,7 +3244,7 @@ static int ixgbe_get_module_eeprom(struct net_device *dev,
|
||||
{
|
||||
struct ixgbe_adapter *adapter = netdev_priv(dev);
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
s32 status = IXGBE_ERR_PHY_ADDR_INVALID;
|
||||
s32 status = -EFAULT;
|
||||
u8 databyte = 0xFF;
|
||||
int i = 0;
|
||||
|
||||
|
||||
@@ -2759,7 +2759,6 @@ static void ixgbe_check_overtemp_subtask(struct ixgbe_adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 eicr = adapter->interrupt_event;
|
||||
s32 rc;
|
||||
|
||||
if (test_bit(__IXGBE_DOWN, &adapter->state))
|
||||
return;
|
||||
@@ -2793,14 +2792,13 @@ static void ixgbe_check_overtemp_subtask(struct ixgbe_adapter *adapter)
|
||||
}
|
||||
|
||||
/* Check if this is not due to overtemp */
|
||||
if (hw->phy.ops.check_overtemp(hw) != IXGBE_ERR_OVERTEMP)
|
||||
if (!hw->phy.ops.check_overtemp(hw))
|
||||
return;
|
||||
|
||||
break;
|
||||
case IXGBE_DEV_ID_X550EM_A_1G_T:
|
||||
case IXGBE_DEV_ID_X550EM_A_1G_T_L:
|
||||
rc = hw->phy.ops.check_overtemp(hw);
|
||||
if (rc != IXGBE_ERR_OVERTEMP)
|
||||
if (!hw->phy.ops.check_overtemp(hw))
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
@@ -5463,7 +5461,7 @@ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw)
|
||||
{
|
||||
u32 speed;
|
||||
bool autoneg, link_up = false;
|
||||
int ret = IXGBE_ERR_LINK_SETUP;
|
||||
int ret = -EIO;
|
||||
|
||||
if (hw->mac.ops.check_link)
|
||||
ret = hw->mac.ops.check_link(hw, &speed, &link_up, false);
|
||||
@@ -5882,13 +5880,13 @@ void ixgbe_reset(struct ixgbe_adapter *adapter)
|
||||
err = hw->mac.ops.init_hw(hw);
|
||||
switch (err) {
|
||||
case 0:
|
||||
case IXGBE_ERR_SFP_NOT_PRESENT:
|
||||
case IXGBE_ERR_SFP_NOT_SUPPORTED:
|
||||
case -ENOENT:
|
||||
case -EOPNOTSUPP:
|
||||
break;
|
||||
case IXGBE_ERR_MASTER_REQUESTS_PENDING:
|
||||
e_dev_err("master disable timed out\n");
|
||||
case -EALREADY:
|
||||
e_dev_err("primary disable timed out\n");
|
||||
break;
|
||||
case IXGBE_ERR_EEPROM_VERSION:
|
||||
case -EACCES:
|
||||
/* We are running on a pre-production device, log a warning */
|
||||
e_dev_warn("This device is a pre-production adapter/LOM. "
|
||||
"Please be aware there may be issues associated with "
|
||||
@@ -7685,10 +7683,10 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
|
||||
adapter->sfp_poll_time = jiffies + IXGBE_SFP_POLL_JIFFIES - 1;
|
||||
|
||||
err = hw->phy.ops.identify_sfp(hw);
|
||||
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED)
|
||||
if (err == -EOPNOTSUPP)
|
||||
goto sfp_out;
|
||||
|
||||
if (err == IXGBE_ERR_SFP_NOT_PRESENT) {
|
||||
if (err == -ENOENT) {
|
||||
/* If no cable is present, then we need to reset
|
||||
* the next time we find a good cable. */
|
||||
adapter->flags2 |= IXGBE_FLAG2_SFP_NEEDS_RESET;
|
||||
@@ -7714,7 +7712,7 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
|
||||
else
|
||||
err = hw->mac.ops.setup_sfp(hw);
|
||||
|
||||
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED)
|
||||
if (err == -EOPNOTSUPP)
|
||||
goto sfp_out;
|
||||
|
||||
adapter->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
|
||||
@@ -7723,8 +7721,8 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
|
||||
sfp_out:
|
||||
clear_bit(__IXGBE_IN_SFP_INIT, &adapter->state);
|
||||
|
||||
if ((err == IXGBE_ERR_SFP_NOT_SUPPORTED) &&
|
||||
(adapter->netdev->reg_state == NETREG_REGISTERED)) {
|
||||
if (err == -EOPNOTSUPP &&
|
||||
adapter->netdev->reg_state == NETREG_REGISTERED) {
|
||||
e_dev_err("failed to initialize because an unsupported "
|
||||
"SFP+ module type was detected.\n");
|
||||
e_dev_err("Reload the driver after installing a "
|
||||
@@ -7794,7 +7792,7 @@ static void ixgbe_service_timer(struct timer_list *t)
|
||||
static void ixgbe_phy_interrupt_subtask(struct ixgbe_adapter *adapter)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 status;
|
||||
bool overtemp;
|
||||
|
||||
if (!(adapter->flags2 & IXGBE_FLAG2_PHY_INTERRUPT))
|
||||
return;
|
||||
@@ -7804,11 +7802,9 @@ static void ixgbe_phy_interrupt_subtask(struct ixgbe_adapter *adapter)
|
||||
if (!hw->phy.ops.handle_lasi)
|
||||
return;
|
||||
|
||||
status = hw->phy.ops.handle_lasi(&adapter->hw);
|
||||
if (status != IXGBE_ERR_OVERTEMP)
|
||||
return;
|
||||
|
||||
e_crit(drv, "%s\n", ixgbe_overheat_msg);
|
||||
hw->phy.ops.handle_lasi(&adapter->hw, &overtemp);
|
||||
if (overtemp)
|
||||
e_crit(drv, "%s\n", ixgbe_overheat_msg);
|
||||
}
|
||||
|
||||
static void ixgbe_reset_subtask(struct ixgbe_adapter *adapter)
|
||||
@@ -10635,9 +10631,9 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
err = hw->mac.ops.reset_hw(hw);
|
||||
hw->phy.reset_if_overtemp = false;
|
||||
ixgbe_set_eee_capable(adapter);
|
||||
if (err == IXGBE_ERR_SFP_NOT_PRESENT) {
|
||||
if (err == -ENOENT) {
|
||||
err = 0;
|
||||
} else if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
|
||||
} else if (err == -EOPNOTSUPP) {
|
||||
e_dev_err("failed to load because an unsupported SFP+ or QSFP module type was detected.\n");
|
||||
e_dev_err("Reload the driver after installing a supported module.\n");
|
||||
goto err_sw_init;
|
||||
@@ -10849,7 +10845,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
|
||||
/* reset the hardware with the new settings */
|
||||
err = hw->mac.ops.start_hw(hw);
|
||||
if (err == IXGBE_ERR_EEPROM_VERSION) {
|
||||
if (err == -EACCES) {
|
||||
/* We are running on a pre-production device, log a warning */
|
||||
e_dev_warn("This device is a pre-production adapter/LOM. "
|
||||
"Please be aware there may be issues associated "
|
||||
|
||||
@@ -24,7 +24,7 @@ s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
|
||||
size = mbx->size;
|
||||
|
||||
if (!mbx->ops)
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
|
||||
return mbx->ops->read(hw, msg, size, mbx_id);
|
||||
}
|
||||
@@ -43,10 +43,10 @@ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
|
||||
struct ixgbe_mbx_info *mbx = &hw->mbx;
|
||||
|
||||
if (size > mbx->size)
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EINVAL;
|
||||
|
||||
if (!mbx->ops)
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
|
||||
return mbx->ops->write(hw, msg, size, mbx_id);
|
||||
}
|
||||
@@ -63,7 +63,7 @@ s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
|
||||
struct ixgbe_mbx_info *mbx = &hw->mbx;
|
||||
|
||||
if (!mbx->ops)
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
|
||||
return mbx->ops->check_for_msg(hw, mbx_id);
|
||||
}
|
||||
@@ -80,7 +80,7 @@ s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
|
||||
struct ixgbe_mbx_info *mbx = &hw->mbx;
|
||||
|
||||
if (!mbx->ops)
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
|
||||
return mbx->ops->check_for_ack(hw, mbx_id);
|
||||
}
|
||||
@@ -97,7 +97,7 @@ s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id)
|
||||
struct ixgbe_mbx_info *mbx = &hw->mbx;
|
||||
|
||||
if (!mbx->ops)
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
|
||||
return mbx->ops->check_for_rst(hw, mbx_id);
|
||||
}
|
||||
@@ -115,12 +115,12 @@ static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
|
||||
int countdown = mbx->timeout;
|
||||
|
||||
if (!countdown || !mbx->ops)
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
|
||||
while (mbx->ops->check_for_msg(hw, mbx_id)) {
|
||||
countdown--;
|
||||
if (!countdown)
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
udelay(mbx->usec_delay);
|
||||
}
|
||||
|
||||
@@ -140,12 +140,12 @@ static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
|
||||
int countdown = mbx->timeout;
|
||||
|
||||
if (!countdown || !mbx->ops)
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
|
||||
while (mbx->ops->check_for_ack(hw, mbx_id)) {
|
||||
countdown--;
|
||||
if (!countdown)
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
udelay(mbx->usec_delay);
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ static s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,
|
||||
s32 ret_val;
|
||||
|
||||
if (!mbx->ops)
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
|
||||
ret_val = ixgbe_poll_for_msg(hw, mbx_id);
|
||||
if (ret_val)
|
||||
@@ -197,7 +197,7 @@ static s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,
|
||||
|
||||
/* exit if either we can't write or there isn't a defined timeout */
|
||||
if (!mbx->ops || !mbx->timeout)
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
|
||||
/* send msg */
|
||||
ret_val = mbx->ops->write(hw, msg, size, mbx_id);
|
||||
@@ -217,7 +217,7 @@ static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -238,7 +238,7 @@ static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,7 +259,7 @@ static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -295,7 +295,7 @@ static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -317,7 +317,7 @@ static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_number)
|
||||
if (p2v_mailbox & IXGBE_PFMAILBOX_PFU)
|
||||
return 0;
|
||||
|
||||
return IXGBE_ERR_MBX;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "ixgbe_type.h"
|
||||
|
||||
#define IXGBE_VFMAILBOX_SIZE 16 /* 16 32 bit words - 64 bytes */
|
||||
#define IXGBE_ERR_MBX -100
|
||||
|
||||
#define IXGBE_VFMAILBOX 0x002FC
|
||||
#define IXGBE_VFMBMEM 0x00200
|
||||
|
||||
@@ -101,7 +101,7 @@ s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr,
|
||||
csum = ~csum;
|
||||
do {
|
||||
if (lock && hw->mac.ops.acquire_swfw_sync(hw, swfw_mask))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
ixgbe_i2c_start(hw);
|
||||
/* Device Address and write indication */
|
||||
if (ixgbe_out_i2c_byte_ack(hw, addr))
|
||||
@@ -149,7 +149,7 @@ s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr,
|
||||
hw_dbg(hw, "I2C byte read combined error.\n");
|
||||
} while (retry < max_retry);
|
||||
|
||||
return IXGBE_ERR_I2C;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,7 +178,7 @@ s32 ixgbe_write_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr,
|
||||
csum = ~csum;
|
||||
do {
|
||||
if (lock && hw->mac.ops.acquire_swfw_sync(hw, swfw_mask))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
ixgbe_i2c_start(hw);
|
||||
/* Device Address and write indication */
|
||||
if (ixgbe_out_i2c_byte_ack(hw, addr))
|
||||
@@ -214,7 +214,7 @@ s32 ixgbe_write_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr,
|
||||
hw_dbg(hw, "I2C byte write combined error.\n");
|
||||
} while (retry < max_retry);
|
||||
|
||||
return IXGBE_ERR_I2C;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -261,8 +261,8 @@ static bool ixgbe_probe_phy(struct ixgbe_hw *hw, u16 phy_addr)
|
||||
**/
|
||||
s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)
|
||||
{
|
||||
u32 status = -EFAULT;
|
||||
u32 phy_addr;
|
||||
u32 status = IXGBE_ERR_PHY_ADDR_INVALID;
|
||||
|
||||
if (!hw->phy.phy_semaphore_mask) {
|
||||
if (hw->bus.lan_id)
|
||||
@@ -281,7 +281,7 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)
|
||||
if (ixgbe_probe_phy(hw, phy_addr))
|
||||
return 0;
|
||||
else
|
||||
return IXGBE_ERR_PHY_ADDR_INVALID;
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) {
|
||||
@@ -404,8 +404,7 @@ s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw)
|
||||
return status;
|
||||
|
||||
/* Don't reset PHY if it's shut down due to overtemp. */
|
||||
if (!hw->phy.reset_if_overtemp &&
|
||||
(IXGBE_ERR_OVERTEMP == hw->phy.ops.check_overtemp(hw)))
|
||||
if (!hw->phy.reset_if_overtemp && hw->phy.ops.check_overtemp(hw))
|
||||
return 0;
|
||||
|
||||
/* Blocked by MNG FW so bail */
|
||||
@@ -453,7 +452,7 @@ s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw)
|
||||
|
||||
if (ctrl & MDIO_CTRL1_RESET) {
|
||||
hw_dbg(hw, "PHY reset polling failed to complete.\n");
|
||||
return IXGBE_ERR_RESET_FAILED;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -495,7 +494,7 @@ s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
|
||||
|
||||
if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) {
|
||||
hw_dbg(hw, "PHY address command did not complete.\n");
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Address cycle complete, setup and write the read
|
||||
@@ -522,7 +521,7 @@ s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
|
||||
|
||||
if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) {
|
||||
hw_dbg(hw, "PHY read command didn't complete\n");
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Read operation is complete. Get the data
|
||||
@@ -554,7 +553,7 @@ s32 ixgbe_read_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
|
||||
phy_data);
|
||||
hw->mac.ops.release_swfw_sync(hw, gssr);
|
||||
} else {
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -599,7 +598,7 @@ s32 ixgbe_write_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr,
|
||||
|
||||
if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) {
|
||||
hw_dbg(hw, "PHY address cmd didn't complete\n");
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -627,7 +626,7 @@ s32 ixgbe_write_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr,
|
||||
|
||||
if ((command & IXGBE_MSCA_MDI_COMMAND) != 0) {
|
||||
hw_dbg(hw, "PHY write cmd didn't complete\n");
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -652,7 +651,7 @@ s32 ixgbe_write_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
|
||||
phy_data);
|
||||
hw->mac.ops.release_swfw_sync(hw, gssr);
|
||||
} else {
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -997,7 +996,7 @@ s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw)
|
||||
|
||||
if ((phy_data & MDIO_CTRL1_RESET) != 0) {
|
||||
hw_dbg(hw, "PHY reset did not complete.\n");
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Get init offsets */
|
||||
@@ -1054,12 +1053,12 @@ s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw)
|
||||
hw_dbg(hw, "SOL\n");
|
||||
} else {
|
||||
hw_dbg(hw, "Bad control value\n");
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
hw_dbg(hw, "Bad control type\n");
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1067,7 +1066,7 @@ s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw)
|
||||
|
||||
err_eeprom:
|
||||
hw_err(hw, "eeprom read at offset %d failed\n", data_offset);
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1085,10 +1084,10 @@ s32 ixgbe_identify_module_generic(struct ixgbe_hw *hw)
|
||||
return ixgbe_identify_qsfp_module_generic(hw);
|
||||
default:
|
||||
hw->phy.sfp_type = ixgbe_sfp_type_not_present;
|
||||
return IXGBE_ERR_SFP_NOT_PRESENT;
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
return IXGBE_ERR_SFP_NOT_PRESENT;
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1113,7 +1112,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
|
||||
|
||||
if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber) {
|
||||
hw->phy.sfp_type = ixgbe_sfp_type_not_present;
|
||||
return IXGBE_ERR_SFP_NOT_PRESENT;
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* LAN ID is needed for sfp_type determination */
|
||||
@@ -1128,7 +1127,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
|
||||
|
||||
if (identifier != IXGBE_SFF_IDENTIFIER_SFP) {
|
||||
hw->phy.type = ixgbe_phy_sfp_unsupported;
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
status = hw->phy.ops.read_i2c_eeprom(hw,
|
||||
IXGBE_SFF_1GBE_COMP_CODES,
|
||||
@@ -1319,7 +1318,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
|
||||
hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
|
||||
hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) {
|
||||
hw->phy.type = ixgbe_phy_sfp_unsupported;
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* Anything else 82598-based is supported */
|
||||
@@ -1343,7 +1342,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
|
||||
}
|
||||
hw_dbg(hw, "SFP+ module not supported\n");
|
||||
hw->phy.type = ixgbe_phy_sfp_unsupported;
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -1353,7 +1352,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
|
||||
hw->phy.id = 0;
|
||||
hw->phy.type = ixgbe_phy_unknown;
|
||||
}
|
||||
return IXGBE_ERR_SFP_NOT_PRESENT;
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1380,7 +1379,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
|
||||
|
||||
if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber_qsfp) {
|
||||
hw->phy.sfp_type = ixgbe_sfp_type_not_present;
|
||||
return IXGBE_ERR_SFP_NOT_PRESENT;
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* LAN ID is needed for sfp_type determination */
|
||||
@@ -1394,7 +1393,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
|
||||
|
||||
if (identifier != IXGBE_SFF_IDENTIFIER_QSFP_PLUS) {
|
||||
hw->phy.type = ixgbe_phy_sfp_unsupported;
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
hw->phy.id = identifier;
|
||||
@@ -1462,7 +1461,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
|
||||
} else {
|
||||
/* unsupported module type */
|
||||
hw->phy.type = ixgbe_phy_sfp_unsupported;
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1522,7 +1521,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
|
||||
}
|
||||
hw_dbg(hw, "QSFP module not supported\n");
|
||||
hw->phy.type = ixgbe_phy_sfp_unsupported;
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1533,7 +1532,7 @@ static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
|
||||
hw->phy.id = 0;
|
||||
hw->phy.type = ixgbe_phy_unknown;
|
||||
|
||||
return IXGBE_ERR_SFP_NOT_PRESENT;
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1553,14 +1552,14 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
|
||||
u16 sfp_type = hw->phy.sfp_type;
|
||||
|
||||
if (hw->phy.sfp_type == ixgbe_sfp_type_unknown)
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (hw->phy.sfp_type == ixgbe_sfp_type_not_present)
|
||||
return IXGBE_ERR_SFP_NOT_PRESENT;
|
||||
return -ENOENT;
|
||||
|
||||
if ((hw->device_id == IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM) &&
|
||||
(hw->phy.sfp_type == ixgbe_sfp_type_da_cu))
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/*
|
||||
* Limiting active cables and 1G Phys must be initialized as
|
||||
@@ -1581,11 +1580,11 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
|
||||
if (hw->eeprom.ops.read(hw, IXGBE_PHY_INIT_OFFSET_NL, list_offset)) {
|
||||
hw_err(hw, "eeprom read at %d failed\n",
|
||||
IXGBE_PHY_INIT_OFFSET_NL);
|
||||
return IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if ((!*list_offset) || (*list_offset == 0xFFFF))
|
||||
return IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT;
|
||||
return -EIO;
|
||||
|
||||
/* Shift offset to first ID word */
|
||||
(*list_offset)++;
|
||||
@@ -1604,7 +1603,7 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
|
||||
goto err_phy;
|
||||
if ((!*data_offset) || (*data_offset == 0xFFFF)) {
|
||||
hw_dbg(hw, "SFP+ module not supported\n");
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@@ -1617,14 +1616,14 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
|
||||
|
||||
if (sfp_id == IXGBE_PHY_INIT_END_NL) {
|
||||
hw_dbg(hw, "No matching SFP+ module found\n");
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_phy:
|
||||
hw_err(hw, "eeprom read at offset %d failed\n", *list_offset);
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1719,7 +1718,7 @@ static s32 ixgbe_read_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset,
|
||||
|
||||
do {
|
||||
if (lock && hw->mac.ops.acquire_swfw_sync(hw, swfw_mask))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
ixgbe_i2c_start(hw);
|
||||
|
||||
@@ -1835,7 +1834,7 @@ static s32 ixgbe_write_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset,
|
||||
u32 swfw_mask = hw->phy.phy_semaphore_mask;
|
||||
|
||||
if (lock && hw->mac.ops.acquire_swfw_sync(hw, swfw_mask))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
do {
|
||||
ixgbe_i2c_start(hw);
|
||||
@@ -2077,7 +2076,7 @@ static s32 ixgbe_get_i2c_ack(struct ixgbe_hw *hw)
|
||||
|
||||
if (ack == 1) {
|
||||
hw_dbg(hw, "I2C ack was not received.\n");
|
||||
status = IXGBE_ERR_I2C;
|
||||
status = -EIO;
|
||||
}
|
||||
|
||||
ixgbe_lower_i2c_clk(hw, &i2cctl);
|
||||
@@ -2149,7 +2148,7 @@ static s32 ixgbe_clock_out_i2c_bit(struct ixgbe_hw *hw, bool data)
|
||||
udelay(IXGBE_I2C_T_LOW);
|
||||
} else {
|
||||
hw_dbg(hw, "I2C data was not set to %X\n", data);
|
||||
return IXGBE_ERR_I2C;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -2245,7 +2244,7 @@ static s32 ixgbe_set_i2c_data(struct ixgbe_hw *hw, u32 *i2cctl, bool data)
|
||||
*i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL(hw));
|
||||
if (data != ixgbe_get_i2c_data(hw, i2cctl)) {
|
||||
hw_dbg(hw, "Error - I2C data was not set to %X.\n", data);
|
||||
return IXGBE_ERR_I2C;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -2315,22 +2314,24 @@ static void ixgbe_i2c_bus_clear(struct ixgbe_hw *hw)
|
||||
* @hw: pointer to hardware structure
|
||||
*
|
||||
* Checks if the LASI temp alarm status was triggered due to overtemp
|
||||
*
|
||||
* Return true when an overtemp event detected, otherwise false.
|
||||
**/
|
||||
s32 ixgbe_tn_check_overtemp(struct ixgbe_hw *hw)
|
||||
bool ixgbe_tn_check_overtemp(struct ixgbe_hw *hw)
|
||||
{
|
||||
u16 phy_data = 0;
|
||||
u32 status;
|
||||
|
||||
if (hw->device_id != IXGBE_DEV_ID_82599_T3_LOM)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
/* Check that the LASI temp alarm status was triggered */
|
||||
hw->phy.ops.read_reg(hw, IXGBE_TN_LASI_STATUS_REG,
|
||||
MDIO_MMD_PMAPMD, &phy_data);
|
||||
status = hw->phy.ops.read_reg(hw, IXGBE_TN_LASI_STATUS_REG,
|
||||
MDIO_MMD_PMAPMD, &phy_data);
|
||||
if (status)
|
||||
return false;
|
||||
|
||||
if (!(phy_data & IXGBE_TN_LASI_STATUS_TEMP_ALARM))
|
||||
return 0;
|
||||
|
||||
return IXGBE_ERR_OVERTEMP;
|
||||
return !!(phy_data & IXGBE_TN_LASI_STATUS_TEMP_ALARM);
|
||||
}
|
||||
|
||||
/** ixgbe_set_copper_phy_power - Control power for copper phy
|
||||
|
||||
@@ -153,7 +153,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw);
|
||||
s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
|
||||
u16 *list_offset,
|
||||
u16 *data_offset);
|
||||
s32 ixgbe_tn_check_overtemp(struct ixgbe_hw *hw);
|
||||
bool ixgbe_tn_check_overtemp(struct ixgbe_hw *hw);
|
||||
s32 ixgbe_read_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset,
|
||||
u8 dev_addr, u8 *data);
|
||||
s32 ixgbe_read_i2c_byte_generic_unlocked(struct ixgbe_hw *hw, u8 byte_offset,
|
||||
|
||||
@@ -1261,7 +1261,7 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
|
||||
break;
|
||||
default:
|
||||
e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]);
|
||||
retval = IXGBE_ERR_MBX;
|
||||
retval = -EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1243,7 +1243,7 @@ struct ixgbe_nvm_version {
|
||||
#define IXGBE_PSRTYPE_RQPL_SHIFT 29
|
||||
|
||||
/* CTRL Bit Masks */
|
||||
#define IXGBE_CTRL_GIO_DIS 0x00000004 /* Global IO Master Disable bit */
|
||||
#define IXGBE_CTRL_GIO_DIS 0x00000004 /* Global IO Primary Disable bit */
|
||||
#define IXGBE_CTRL_LNK_RST 0x00000008 /* Link Reset. Resets everything. */
|
||||
#define IXGBE_CTRL_RST 0x04000000 /* Reset (SW) */
|
||||
#define IXGBE_CTRL_RST_MASK (IXGBE_CTRL_LNK_RST | IXGBE_CTRL_RST)
|
||||
@@ -1806,7 +1806,7 @@ enum {
|
||||
/* STATUS Bit Masks */
|
||||
#define IXGBE_STATUS_LAN_ID 0x0000000C /* LAN ID */
|
||||
#define IXGBE_STATUS_LAN_ID_SHIFT 2 /* LAN ID Shift*/
|
||||
#define IXGBE_STATUS_GIO 0x00080000 /* GIO Master Enable Status */
|
||||
#define IXGBE_STATUS_GIO 0x00080000 /* GIO Primary Enable Status */
|
||||
|
||||
#define IXGBE_STATUS_LAN_ID_0 0x00000000 /* LAN ID 0 */
|
||||
#define IXGBE_STATUS_LAN_ID_1 0x00000004 /* LAN ID 1 */
|
||||
@@ -2188,8 +2188,8 @@ enum {
|
||||
#define IXGBE_PCIDEVCTRL2_4_8s 0xd
|
||||
#define IXGBE_PCIDEVCTRL2_17_34s 0xe
|
||||
|
||||
/* Number of 100 microseconds we wait for PCI Express master disable */
|
||||
#define IXGBE_PCI_MASTER_DISABLE_TIMEOUT 800
|
||||
/* Number of 100 microseconds we wait for PCI Express primary disable */
|
||||
#define IXGBE_PCI_PRIMARY_DISABLE_TIMEOUT 800
|
||||
|
||||
/* RAH */
|
||||
#define IXGBE_RAH_VIND_MASK 0x003C0000
|
||||
@@ -3493,10 +3493,10 @@ struct ixgbe_phy_operations {
|
||||
s32 (*read_i2c_sff8472)(struct ixgbe_hw *, u8 , u8 *);
|
||||
s32 (*read_i2c_eeprom)(struct ixgbe_hw *, u8 , u8 *);
|
||||
s32 (*write_i2c_eeprom)(struct ixgbe_hw *, u8, u8);
|
||||
s32 (*check_overtemp)(struct ixgbe_hw *);
|
||||
bool (*check_overtemp)(struct ixgbe_hw *);
|
||||
s32 (*set_phy_power)(struct ixgbe_hw *, bool on);
|
||||
s32 (*enter_lplu)(struct ixgbe_hw *);
|
||||
s32 (*handle_lasi)(struct ixgbe_hw *hw);
|
||||
s32 (*handle_lasi)(struct ixgbe_hw *hw, bool *);
|
||||
s32 (*read_i2c_byte_unlocked)(struct ixgbe_hw *, u8 offset, u8 addr,
|
||||
u8 *value);
|
||||
s32 (*write_i2c_byte_unlocked)(struct ixgbe_hw *, u8 offset, u8 addr,
|
||||
@@ -3649,45 +3649,6 @@ struct ixgbe_info {
|
||||
const u32 *mvals;
|
||||
};
|
||||
|
||||
|
||||
/* Error Codes */
|
||||
#define IXGBE_ERR_EEPROM -1
|
||||
#define IXGBE_ERR_EEPROM_CHECKSUM -2
|
||||
#define IXGBE_ERR_PHY -3
|
||||
#define IXGBE_ERR_CONFIG -4
|
||||
#define IXGBE_ERR_PARAM -5
|
||||
#define IXGBE_ERR_MAC_TYPE -6
|
||||
#define IXGBE_ERR_UNKNOWN_PHY -7
|
||||
#define IXGBE_ERR_LINK_SETUP -8
|
||||
#define IXGBE_ERR_ADAPTER_STOPPED -9
|
||||
#define IXGBE_ERR_INVALID_MAC_ADDR -10
|
||||
#define IXGBE_ERR_DEVICE_NOT_SUPPORTED -11
|
||||
#define IXGBE_ERR_MASTER_REQUESTS_PENDING -12
|
||||
#define IXGBE_ERR_INVALID_LINK_SETTINGS -13
|
||||
#define IXGBE_ERR_AUTONEG_NOT_COMPLETE -14
|
||||
#define IXGBE_ERR_RESET_FAILED -15
|
||||
#define IXGBE_ERR_SWFW_SYNC -16
|
||||
#define IXGBE_ERR_PHY_ADDR_INVALID -17
|
||||
#define IXGBE_ERR_I2C -18
|
||||
#define IXGBE_ERR_SFP_NOT_SUPPORTED -19
|
||||
#define IXGBE_ERR_SFP_NOT_PRESENT -20
|
||||
#define IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT -21
|
||||
#define IXGBE_ERR_NO_SAN_ADDR_PTR -22
|
||||
#define IXGBE_ERR_FDIR_REINIT_FAILED -23
|
||||
#define IXGBE_ERR_EEPROM_VERSION -24
|
||||
#define IXGBE_ERR_NO_SPACE -25
|
||||
#define IXGBE_ERR_OVERTEMP -26
|
||||
#define IXGBE_ERR_FC_NOT_NEGOTIATED -27
|
||||
#define IXGBE_ERR_FC_NOT_SUPPORTED -28
|
||||
#define IXGBE_ERR_SFP_SETUP_NOT_COMPLETE -30
|
||||
#define IXGBE_ERR_PBA_SECTION -31
|
||||
#define IXGBE_ERR_INVALID_ARGUMENT -32
|
||||
#define IXGBE_ERR_HOST_INTERFACE_COMMAND -33
|
||||
#define IXGBE_ERR_FDIR_CMD_INCOMPLETE -38
|
||||
#define IXGBE_ERR_FW_RESP_INVALID -39
|
||||
#define IXGBE_ERR_TOKEN_RETRY -40
|
||||
#define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF
|
||||
|
||||
#define IXGBE_FUSES0_GROUP(_i) (0x11158 + ((_i) * 4))
|
||||
#define IXGBE_FUSES0_300MHZ BIT(5)
|
||||
#define IXGBE_FUSES0_REV_MASK (3u << 6)
|
||||
|
||||
@@ -84,7 +84,7 @@ s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw)
|
||||
status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
|
||||
if (status) {
|
||||
hw_dbg(hw, "semaphore failed with %d", status);
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
ctrl = IXGBE_CTRL_RST;
|
||||
@@ -103,7 +103,7 @@ s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw)
|
||||
}
|
||||
|
||||
if (ctrl & IXGBE_CTRL_RST_MASK) {
|
||||
status = IXGBE_ERR_RESET_FAILED;
|
||||
status = -EIO;
|
||||
hw_dbg(hw, "Reset polling failed to complete.\n");
|
||||
}
|
||||
msleep(100);
|
||||
@@ -220,7 +220,7 @@ static s32 ixgbe_read_eerd_X540(struct ixgbe_hw *hw, u16 offset, u16 *data)
|
||||
s32 status;
|
||||
|
||||
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
status = ixgbe_read_eerd_generic(hw, offset, data);
|
||||
|
||||
@@ -243,7 +243,7 @@ static s32 ixgbe_read_eerd_buffer_X540(struct ixgbe_hw *hw,
|
||||
s32 status;
|
||||
|
||||
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
status = ixgbe_read_eerd_buffer_generic(hw, offset, words, data);
|
||||
|
||||
@@ -264,7 +264,7 @@ static s32 ixgbe_write_eewr_X540(struct ixgbe_hw *hw, u16 offset, u16 data)
|
||||
s32 status;
|
||||
|
||||
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
status = ixgbe_write_eewr_generic(hw, offset, data);
|
||||
|
||||
@@ -287,7 +287,7 @@ static s32 ixgbe_write_eewr_buffer_X540(struct ixgbe_hw *hw,
|
||||
s32 status;
|
||||
|
||||
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
status = ixgbe_write_eewr_buffer_generic(hw, offset, words, data);
|
||||
|
||||
@@ -324,7 +324,7 @@ static s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)
|
||||
for (i = 0; i < checksum_last_word; i++) {
|
||||
if (ixgbe_read_eerd_generic(hw, i, &word)) {
|
||||
hw_dbg(hw, "EEPROM read failed\n");
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
checksum += word;
|
||||
}
|
||||
@@ -349,8 +349,7 @@ static s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)
|
||||
|
||||
if (ixgbe_read_eerd_generic(hw, pointer, &length)) {
|
||||
hw_dbg(hw, "EEPROM read failed\n");
|
||||
return IXGBE_ERR_EEPROM;
|
||||
break;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Skip pointer section if length is invalid. */
|
||||
@@ -361,7 +360,7 @@ static s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)
|
||||
for (j = pointer + 1; j <= pointer + length; j++) {
|
||||
if (ixgbe_read_eerd_generic(hw, j, &word)) {
|
||||
hw_dbg(hw, "EEPROM read failed\n");
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
checksum += word;
|
||||
}
|
||||
@@ -398,7 +397,7 @@ static s32 ixgbe_validate_eeprom_checksum_X540(struct ixgbe_hw *hw,
|
||||
}
|
||||
|
||||
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
status = hw->eeprom.ops.calc_checksum(hw);
|
||||
if (status < 0)
|
||||
@@ -419,7 +418,7 @@ static s32 ixgbe_validate_eeprom_checksum_X540(struct ixgbe_hw *hw,
|
||||
*/
|
||||
if (read_checksum != checksum) {
|
||||
hw_dbg(hw, "Invalid EEPROM checksum");
|
||||
status = IXGBE_ERR_EEPROM_CHECKSUM;
|
||||
status = -EIO;
|
||||
}
|
||||
|
||||
/* If the user cares, return the calculated checksum */
|
||||
@@ -456,7 +455,7 @@ static s32 ixgbe_update_eeprom_checksum_X540(struct ixgbe_hw *hw)
|
||||
}
|
||||
|
||||
if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
status = hw->eeprom.ops.calc_checksum(hw);
|
||||
if (status < 0)
|
||||
@@ -491,7 +490,7 @@ static s32 ixgbe_update_flash_X540(struct ixgbe_hw *hw)
|
||||
s32 status;
|
||||
|
||||
status = ixgbe_poll_flash_update_done_X540(hw);
|
||||
if (status == IXGBE_ERR_EEPROM) {
|
||||
if (status == -EIO) {
|
||||
hw_dbg(hw, "Flash update time out\n");
|
||||
return status;
|
||||
}
|
||||
@@ -541,7 +540,7 @@ static s32 ixgbe_poll_flash_update_done_X540(struct ixgbe_hw *hw)
|
||||
return 0;
|
||||
udelay(5);
|
||||
}
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -576,7 +575,7 @@ s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask)
|
||||
* SW_FW_SYNC bits (not just NVM)
|
||||
*/
|
||||
if (ixgbe_get_swfw_sync_semaphore(hw))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw));
|
||||
if (!(swfw_sync & (fwmask | swmask | hwmask))) {
|
||||
@@ -600,7 +599,7 @@ s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask)
|
||||
* bits in the SW_FW_SYNC register.
|
||||
*/
|
||||
if (ixgbe_get_swfw_sync_semaphore(hw))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw));
|
||||
if (swfw_sync & (fwmask | hwmask)) {
|
||||
swfw_sync |= swmask;
|
||||
@@ -623,11 +622,11 @@ s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask)
|
||||
rmask |= IXGBE_GSSR_I2C_MASK;
|
||||
ixgbe_release_swfw_sync_X540(hw, rmask);
|
||||
ixgbe_release_swfw_sync_semaphore(hw);
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
}
|
||||
ixgbe_release_swfw_sync_semaphore(hw);
|
||||
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -681,7 +680,7 @@ static s32 ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw)
|
||||
if (i == timeout) {
|
||||
hw_dbg(hw,
|
||||
"Software semaphore SMBI between device drivers not granted.\n");
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Now get the semaphore between SW/FW through the REGSMP bit */
|
||||
@@ -698,7 +697,7 @@ static s32 ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw)
|
||||
*/
|
||||
hw_dbg(hw, "REGSMP Software NVM semaphore not granted\n");
|
||||
ixgbe_release_swfw_sync_semaphore(hw);
|
||||
return IXGBE_ERR_EEPROM;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -769,7 +768,7 @@ s32 ixgbe_blink_led_start_X540(struct ixgbe_hw *hw, u32 index)
|
||||
bool link_up;
|
||||
|
||||
if (index > 3)
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
|
||||
/* Link should be up in order for the blink bit in the LED control
|
||||
* register to work. Force link and speed in the MAC if link is down.
|
||||
@@ -805,7 +804,7 @@ s32 ixgbe_blink_led_stop_X540(struct ixgbe_hw *hw, u32 index)
|
||||
u32 ledctl_reg;
|
||||
|
||||
if (index > 3)
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
|
||||
/* Restore the LED to its default value. */
|
||||
ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
||||
|
||||
@@ -206,13 +206,13 @@ static s32 ixgbe_reset_cs4227(struct ixgbe_hw *hw)
|
||||
}
|
||||
if (retry == IXGBE_CS4227_RETRIES) {
|
||||
hw_err(hw, "CS4227 reset did not complete\n");
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EEPROM_STATUS, &value);
|
||||
if (status || !(value & IXGBE_CS4227_EEPROM_LOAD_OK)) {
|
||||
hw_err(hw, "CS4227 EEPROM did not load successfully\n");
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -350,13 +350,13 @@ static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw)
|
||||
static s32 ixgbe_read_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr,
|
||||
u32 device_type, u16 *phy_data)
|
||||
{
|
||||
return IXGBE_NOT_IMPLEMENTED;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static s32 ixgbe_write_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr,
|
||||
u32 device_type, u16 phy_data)
|
||||
{
|
||||
return IXGBE_NOT_IMPLEMENTED;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -463,7 +463,7 @@ s32 ixgbe_fw_phy_activity(struct ixgbe_hw *hw, u16 activity,
|
||||
--retries;
|
||||
} while (retries > 0);
|
||||
|
||||
return IXGBE_ERR_HOST_INTERFACE_COMMAND;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
static const struct {
|
||||
@@ -511,7 +511,7 @@ static s32 ixgbe_get_phy_id_fw(struct ixgbe_hw *hw)
|
||||
hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK;
|
||||
hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK;
|
||||
if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK)
|
||||
return IXGBE_ERR_PHY_ADDR_INVALID;
|
||||
return -EFAULT;
|
||||
|
||||
hw->phy.autoneg_advertised = hw->phy.speeds_supported;
|
||||
hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_100_FULL |
|
||||
@@ -568,7 +568,7 @@ static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw)
|
||||
|
||||
if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
|
||||
hw_err(hw, "rx_pause not valid in strict IEEE mode\n");
|
||||
return IXGBE_ERR_INVALID_LINK_SETTINGS;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (hw->fc.requested_mode) {
|
||||
@@ -600,8 +600,10 @@ static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw)
|
||||
rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_SETUP_LINK, &setup);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
if (setup[0] == FW_PHY_ACT_SETUP_LINK_RSP_DOWN)
|
||||
return IXGBE_ERR_OVERTEMP;
|
||||
return -EIO;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -675,7 +677,7 @@ static s32 ixgbe_iosf_wait(struct ixgbe_hw *hw, u32 *ctrl)
|
||||
*ctrl = command;
|
||||
if (i == IXGBE_MDIO_COMMAND_TIMEOUT) {
|
||||
hw_dbg(hw, "IOSF wait timed out\n");
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -715,7 +717,8 @@ static s32 ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr,
|
||||
error = (command & IXGBE_SB_IOSF_CTRL_CMPL_ERR_MASK) >>
|
||||
IXGBE_SB_IOSF_CTRL_CMPL_ERR_SHIFT;
|
||||
hw_dbg(hw, "Failed to read, error %x\n", error);
|
||||
return IXGBE_ERR_PHY;
|
||||
ret = -EIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
@@ -750,9 +753,9 @@ static s32 ixgbe_get_phy_token(struct ixgbe_hw *hw)
|
||||
if (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK)
|
||||
return 0;
|
||||
if (token_cmd.hdr.cmd_or_resp.ret_status != FW_PHY_TOKEN_RETRY)
|
||||
return IXGBE_ERR_FW_RESP_INVALID;
|
||||
return -EIO;
|
||||
|
||||
return IXGBE_ERR_TOKEN_RETRY;
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -778,7 +781,7 @@ static s32 ixgbe_put_phy_token(struct ixgbe_hw *hw)
|
||||
return status;
|
||||
if (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK)
|
||||
return 0;
|
||||
return IXGBE_ERR_FW_RESP_INVALID;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -942,7 +945,7 @@ static s32 ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, u16 ptr,
|
||||
local_buffer = buf;
|
||||
} else {
|
||||
if (buffer_size < ptr)
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
local_buffer = &buffer[ptr];
|
||||
}
|
||||
|
||||
@@ -960,7 +963,7 @@ static s32 ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, u16 ptr,
|
||||
}
|
||||
|
||||
if (buffer && ((u32)start + (u32)length > buffer_size))
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
|
||||
for (i = start; length; i++, length--) {
|
||||
if (i == bufsz && !buffer) {
|
||||
@@ -1012,7 +1015,7 @@ static s32 ixgbe_calc_checksum_X550(struct ixgbe_hw *hw, u16 *buffer,
|
||||
local_buffer = eeprom_ptrs;
|
||||
} else {
|
||||
if (buffer_size < IXGBE_EEPROM_LAST_WORD)
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
local_buffer = buffer;
|
||||
}
|
||||
|
||||
@@ -1148,7 +1151,7 @@ static s32 ixgbe_validate_eeprom_checksum_X550(struct ixgbe_hw *hw,
|
||||
* calculated checksum
|
||||
*/
|
||||
if (read_checksum != checksum) {
|
||||
status = IXGBE_ERR_EEPROM_CHECKSUM;
|
||||
status = -EIO;
|
||||
hw_dbg(hw, "Invalid EEPROM checksum");
|
||||
}
|
||||
|
||||
@@ -1203,7 +1206,7 @@ static s32 ixgbe_write_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 data)
|
||||
hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);
|
||||
} else {
|
||||
hw_dbg(hw, "write ee hostif failed to get semaphore");
|
||||
status = IXGBE_ERR_SWFW_SYNC;
|
||||
status = -EBUSY;
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -1401,7 +1404,7 @@ static s32 ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr,
|
||||
error = (command & IXGBE_SB_IOSF_CTRL_CMPL_ERR_MASK) >>
|
||||
IXGBE_SB_IOSF_CTRL_CMPL_ERR_SHIFT;
|
||||
hw_dbg(hw, "Failed to write, error %x\n", error);
|
||||
return IXGBE_ERR_PHY;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
out:
|
||||
@@ -1544,7 +1547,7 @@ static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
|
||||
|
||||
/* iXFI is only supported with X552 */
|
||||
if (mac->type != ixgbe_mac_X550EM_x)
|
||||
return IXGBE_ERR_LINK_SETUP;
|
||||
return -EIO;
|
||||
|
||||
/* Disable AN and force speed to 10G Serial. */
|
||||
status = ixgbe_read_iosf_sb_reg_x550(hw,
|
||||
@@ -1566,7 +1569,7 @@ static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
|
||||
break;
|
||||
default:
|
||||
/* Other link speeds are not supported by internal KR PHY. */
|
||||
return IXGBE_ERR_LINK_SETUP;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = ixgbe_write_iosf_sb_reg_x550(hw,
|
||||
@@ -1597,7 +1600,7 @@ static s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear)
|
||||
{
|
||||
switch (hw->phy.sfp_type) {
|
||||
case ixgbe_sfp_type_not_present:
|
||||
return IXGBE_ERR_SFP_NOT_PRESENT;
|
||||
return -ENOENT;
|
||||
case ixgbe_sfp_type_da_cu_core0:
|
||||
case ixgbe_sfp_type_da_cu_core1:
|
||||
*linear = true;
|
||||
@@ -1616,7 +1619,7 @@ static s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear)
|
||||
case ixgbe_sfp_type_1g_cu_core0:
|
||||
case ixgbe_sfp_type_1g_cu_core1:
|
||||
default:
|
||||
return IXGBE_ERR_SFP_NOT_SUPPORTED;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1646,7 +1649,7 @@ ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw,
|
||||
* there is no reason to configure CS4227 and SFP not present error is
|
||||
* not accepted in the setup MAC link flow.
|
||||
*/
|
||||
if (status == IXGBE_ERR_SFP_NOT_PRESENT)
|
||||
if (status == -ENOENT)
|
||||
return 0;
|
||||
|
||||
if (status)
|
||||
@@ -1704,7 +1707,7 @@ static s32 ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
|
||||
break;
|
||||
default:
|
||||
/* Other link speeds are not supported by internal PHY. */
|
||||
return IXGBE_ERR_LINK_SETUP;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = mac->ops.write_iosf_sb_reg(hw,
|
||||
@@ -1739,7 +1742,7 @@ ixgbe_setup_mac_link_sfp_n(struct ixgbe_hw *hw, ixgbe_link_speed speed,
|
||||
/* If no SFP module present, then return success. Return success since
|
||||
* SFP not present error is not excepted in the setup MAC link flow.
|
||||
*/
|
||||
if (ret_val == IXGBE_ERR_SFP_NOT_PRESENT)
|
||||
if (ret_val == -ENOENT)
|
||||
return 0;
|
||||
|
||||
if (ret_val)
|
||||
@@ -1789,7 +1792,7 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
|
||||
/* If no SFP module present, then return success. Return success since
|
||||
* SFP not present error is not excepted in the setup MAC link flow.
|
||||
*/
|
||||
if (ret_val == IXGBE_ERR_SFP_NOT_PRESENT)
|
||||
if (ret_val == -ENOENT)
|
||||
return 0;
|
||||
|
||||
if (ret_val)
|
||||
@@ -1799,7 +1802,7 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
|
||||
ixgbe_setup_kr_speed_x550em(hw, speed);
|
||||
|
||||
if (hw->phy.mdio.prtad == MDIO_PRTAD_NONE)
|
||||
return IXGBE_ERR_PHY_ADDR_INVALID;
|
||||
return -EFAULT;
|
||||
|
||||
/* Get external PHY SKU id */
|
||||
ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU,
|
||||
@@ -1898,7 +1901,7 @@ static s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw,
|
||||
u16 i, autoneg_status;
|
||||
|
||||
if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
|
||||
status = ixgbe_check_mac_link_generic(hw, speed, link_up,
|
||||
link_up_wait_to_complete);
|
||||
@@ -2081,9 +2084,9 @@ static s32 ixgbe_setup_sgmii_fw(struct ixgbe_hw *hw, ixgbe_link_speed speed,
|
||||
*/
|
||||
static void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw)
|
||||
{
|
||||
s32 status = IXGBE_ERR_FC_NOT_NEGOTIATED;
|
||||
u32 info[FW_PHY_ACT_DATA_COUNT] = { 0 };
|
||||
ixgbe_link_speed speed;
|
||||
s32 status = -EIO;
|
||||
bool link_up;
|
||||
|
||||
/* AN should have completed when the cable was plugged in.
|
||||
@@ -2101,7 +2104,7 @@ static void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw)
|
||||
/* Check if auto-negotiation has completed */
|
||||
status = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &info);
|
||||
if (status || !(info[0] & FW_PHY_ACT_GET_LINK_INFO_AN_COMPLETE)) {
|
||||
status = IXGBE_ERR_FC_NOT_NEGOTIATED;
|
||||
status = -EIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -2305,18 +2308,18 @@ static s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw,
|
||||
* @hw: pointer to hardware structure
|
||||
* @lsc: pointer to boolean flag which indicates whether external Base T
|
||||
* PHY interrupt is lsc
|
||||
* @is_overtemp: indicate whether an overtemp event encountered
|
||||
*
|
||||
* Determime if external Base T PHY interrupt cause is high temperature
|
||||
* failure alarm or link status change.
|
||||
*
|
||||
* Return IXGBE_ERR_OVERTEMP if interrupt is high temperature
|
||||
* failure alarm, else return PHY access status.
|
||||
**/
|
||||
static s32 ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc)
|
||||
static s32 ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc,
|
||||
bool *is_overtemp)
|
||||
{
|
||||
u32 status;
|
||||
u16 reg;
|
||||
|
||||
*is_overtemp = false;
|
||||
*lsc = false;
|
||||
|
||||
/* Vendor alarm triggered */
|
||||
@@ -2348,7 +2351,8 @@ static s32 ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc)
|
||||
if (reg & IXGBE_MDIO_GLOBAL_ALM_1_HI_TMP_FAIL) {
|
||||
/* power down the PHY in case the PHY FW didn't already */
|
||||
ixgbe_set_copper_phy_power(hw, false);
|
||||
return IXGBE_ERR_OVERTEMP;
|
||||
*is_overtemp = true;
|
||||
return -EIO;
|
||||
}
|
||||
if (reg & IXGBE_MDIO_GLOBAL_ALM_1_DEV_FAULT) {
|
||||
/* device fault alarm triggered */
|
||||
@@ -2362,7 +2366,8 @@ static s32 ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc)
|
||||
if (reg == IXGBE_MDIO_GLOBAL_FAULT_MSG_HI_TMP) {
|
||||
/* power down the PHY in case the PHY FW didn't */
|
||||
ixgbe_set_copper_phy_power(hw, false);
|
||||
return IXGBE_ERR_OVERTEMP;
|
||||
*is_overtemp = true;
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2398,12 +2403,12 @@ static s32 ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc)
|
||||
**/
|
||||
static s32 ixgbe_enable_lasi_ext_t_x550em(struct ixgbe_hw *hw)
|
||||
{
|
||||
bool lsc, overtemp;
|
||||
u32 status;
|
||||
u16 reg;
|
||||
bool lsc;
|
||||
|
||||
/* Clear interrupt flags */
|
||||
status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc);
|
||||
status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc, &overtemp);
|
||||
|
||||
/* Enable link status change alarm */
|
||||
|
||||
@@ -2482,21 +2487,20 @@ static s32 ixgbe_enable_lasi_ext_t_x550em(struct ixgbe_hw *hw)
|
||||
/**
|
||||
* ixgbe_handle_lasi_ext_t_x550em - Handle external Base T PHY interrupt
|
||||
* @hw: pointer to hardware structure
|
||||
* @is_overtemp: indicate whether an overtemp event encountered
|
||||
*
|
||||
* Handle external Base T PHY interrupt. If high temperature
|
||||
* failure alarm then return error, else if link status change
|
||||
* then setup internal/external PHY link
|
||||
*
|
||||
* Return IXGBE_ERR_OVERTEMP if interrupt is high temperature
|
||||
* failure alarm, else return PHY access status.
|
||||
**/
|
||||
static s32 ixgbe_handle_lasi_ext_t_x550em(struct ixgbe_hw *hw)
|
||||
static s32 ixgbe_handle_lasi_ext_t_x550em(struct ixgbe_hw *hw,
|
||||
bool *is_overtemp)
|
||||
{
|
||||
struct ixgbe_phy_info *phy = &hw->phy;
|
||||
bool lsc;
|
||||
u32 status;
|
||||
|
||||
status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc);
|
||||
status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc, is_overtemp);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
@@ -2628,7 +2632,7 @@ static s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw)
|
||||
u16 speed;
|
||||
|
||||
if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
|
||||
if (!(hw->mac.type == ixgbe_mac_X550EM_x &&
|
||||
!(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE))) {
|
||||
@@ -2671,7 +2675,7 @@ static s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw)
|
||||
break;
|
||||
default:
|
||||
/* Internal PHY does not support anything else */
|
||||
return IXGBE_ERR_INVALID_LINK_SETTINGS;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return ixgbe_setup_ixfi_x550em(hw, &force_speed);
|
||||
@@ -2703,7 +2707,7 @@ static s32 ixgbe_led_on_t_x550em(struct ixgbe_hw *hw, u32 led_idx)
|
||||
u16 phy_data;
|
||||
|
||||
if (led_idx >= IXGBE_X557_MAX_LED_INDEX)
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
|
||||
/* To turn on the LED, set mode to ON. */
|
||||
hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
|
||||
@@ -2725,7 +2729,7 @@ static s32 ixgbe_led_off_t_x550em(struct ixgbe_hw *hw, u32 led_idx)
|
||||
u16 phy_data;
|
||||
|
||||
if (led_idx >= IXGBE_X557_MAX_LED_INDEX)
|
||||
return IXGBE_ERR_PARAM;
|
||||
return -EINVAL;
|
||||
|
||||
/* To turn on the LED, set mode to ON. */
|
||||
hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
|
||||
@@ -2749,8 +2753,9 @@ static s32 ixgbe_led_off_t_x550em(struct ixgbe_hw *hw, u32 led_idx)
|
||||
*
|
||||
* Sends driver version number to firmware through the manageability
|
||||
* block. On success return 0
|
||||
* else returns IXGBE_ERR_SWFW_SYNC when encountering an error acquiring
|
||||
* semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails.
|
||||
* else returns -EBUSY when encountering an error acquiring
|
||||
* semaphore, -EIO when command fails or -ENIVAL when incorrect
|
||||
* params passed.
|
||||
**/
|
||||
static s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,
|
||||
u8 build, u8 sub, u16 len,
|
||||
@@ -2761,7 +2766,7 @@ static s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,
|
||||
int i;
|
||||
|
||||
if (!len || !driver_ver || (len > sizeof(fw_cmd.driver_string)))
|
||||
return IXGBE_ERR_INVALID_ARGUMENT;
|
||||
return -EINVAL;
|
||||
|
||||
fw_cmd.hdr.cmd = FW_CEM_CMD_DRIVER_INFO;
|
||||
fw_cmd.hdr.buf_len = FW_CEM_CMD_DRIVER_INFO_LEN + len;
|
||||
@@ -2786,7 +2791,7 @@ static s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,
|
||||
|
||||
if (fw_cmd.hdr.cmd_or_resp.ret_status !=
|
||||
FW_CEM_RESP_STATUS_SUCCESS)
|
||||
return IXGBE_ERR_HOST_INTERFACE_COMMAND;
|
||||
return -EIO;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2843,7 +2848,7 @@ static s32 ixgbe_setup_fc_x550em(struct ixgbe_hw *hw)
|
||||
/* Validate the requested mode */
|
||||
if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
|
||||
hw_err(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n");
|
||||
return IXGBE_ERR_INVALID_LINK_SETTINGS;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* 10gig parts do not have a word in the EEPROM to determine the
|
||||
@@ -2878,7 +2883,7 @@ static s32 ixgbe_setup_fc_x550em(struct ixgbe_hw *hw)
|
||||
break;
|
||||
default:
|
||||
hw_err(hw, "Flow control param set incorrectly\n");
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
switch (hw->device_id) {
|
||||
@@ -2922,8 +2927,8 @@ static s32 ixgbe_setup_fc_x550em(struct ixgbe_hw *hw)
|
||||
static void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw)
|
||||
{
|
||||
u32 link_s1, lp_an_page_low, an_cntl_1;
|
||||
s32 status = IXGBE_ERR_FC_NOT_NEGOTIATED;
|
||||
ixgbe_link_speed speed;
|
||||
s32 status = -EIO;
|
||||
bool link_up;
|
||||
|
||||
/* AN should have completed when the cable was plugged in.
|
||||
@@ -2949,7 +2954,7 @@ static void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw)
|
||||
|
||||
if (status || (link_s1 & IXGBE_KRM_LINK_S1_MAC_AN_COMPLETE) == 0) {
|
||||
hw_dbg(hw, "Auto-Negotiation did not complete\n");
|
||||
status = IXGBE_ERR_FC_NOT_NEGOTIATED;
|
||||
status = -EIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -3123,21 +3128,23 @@ static s32 ixgbe_reset_phy_fw(struct ixgbe_hw *hw)
|
||||
/**
|
||||
* ixgbe_check_overtemp_fw - Check firmware-controlled PHYs for overtemp
|
||||
* @hw: pointer to hardware structure
|
||||
*
|
||||
* Return true when an overtemp event detected, otherwise false.
|
||||
*/
|
||||
static s32 ixgbe_check_overtemp_fw(struct ixgbe_hw *hw)
|
||||
static bool ixgbe_check_overtemp_fw(struct ixgbe_hw *hw)
|
||||
{
|
||||
u32 store[FW_PHY_ACT_DATA_COUNT] = { 0 };
|
||||
s32 rc;
|
||||
|
||||
rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &store);
|
||||
if (rc)
|
||||
return rc;
|
||||
return false;
|
||||
|
||||
if (store[0] & FW_PHY_ACT_GET_LINK_INFO_TEMP) {
|
||||
ixgbe_shutdown_fw_phy(hw);
|
||||
return IXGBE_ERR_OVERTEMP;
|
||||
return true;
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3187,8 +3194,7 @@ static s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
|
||||
|
||||
/* Identify the PHY or SFP module */
|
||||
ret_val = phy->ops.identify(hw);
|
||||
if (ret_val == IXGBE_ERR_SFP_NOT_SUPPORTED ||
|
||||
ret_val == IXGBE_ERR_PHY_ADDR_INVALID)
|
||||
if (ret_val == -EOPNOTSUPP || ret_val == -EFAULT)
|
||||
return ret_val;
|
||||
|
||||
/* Setup function pointers based on detected hardware */
|
||||
@@ -3396,8 +3402,7 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
|
||||
|
||||
/* PHY ops must be identified and initialized prior to reset */
|
||||
status = hw->phy.ops.init(hw);
|
||||
if (status == IXGBE_ERR_SFP_NOT_SUPPORTED ||
|
||||
status == IXGBE_ERR_PHY_ADDR_INVALID)
|
||||
if (status == -EOPNOTSUPP || status == -EFAULT)
|
||||
return status;
|
||||
|
||||
/* start the external PHY */
|
||||
@@ -3413,7 +3418,7 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
|
||||
hw->phy.sfp_setup_needed = false;
|
||||
}
|
||||
|
||||
if (status == IXGBE_ERR_SFP_NOT_SUPPORTED)
|
||||
if (status == -EOPNOTSUPP)
|
||||
return status;
|
||||
|
||||
/* Reset PHY */
|
||||
@@ -3437,7 +3442,7 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
|
||||
status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
|
||||
if (status) {
|
||||
hw_dbg(hw, "semaphore failed with %d", status);
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL);
|
||||
@@ -3455,7 +3460,7 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
|
||||
}
|
||||
|
||||
if (ctrl & IXGBE_CTRL_RST_MASK) {
|
||||
status = IXGBE_ERR_RESET_FAILED;
|
||||
status = -EIO;
|
||||
hw_dbg(hw, "Reset polling failed to complete.\n");
|
||||
}
|
||||
|
||||
@@ -3551,7 +3556,7 @@ static s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw)
|
||||
/* Validate the requested mode */
|
||||
if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
|
||||
hw_err(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n");
|
||||
return IXGBE_ERR_INVALID_LINK_SETTINGS;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (hw->fc.requested_mode == ixgbe_fc_default)
|
||||
@@ -3608,7 +3613,7 @@ static s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw)
|
||||
break;
|
||||
default:
|
||||
hw_err(hw, "Flow control param set incorrectly\n");
|
||||
return IXGBE_ERR_CONFIG;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
status = hw->mac.ops.write_iosf_sb_reg(hw,
|
||||
@@ -3704,7 +3709,7 @@ static s32 ixgbe_acquire_swfw_sync_x550em_a(struct ixgbe_hw *hw, u32 mask)
|
||||
return 0;
|
||||
if (hmask)
|
||||
ixgbe_release_swfw_sync_X540(hw, hmask);
|
||||
if (status != IXGBE_ERR_TOKEN_RETRY)
|
||||
if (status != -EAGAIN)
|
||||
return status;
|
||||
msleep(FW_PHY_TOKEN_DELAY);
|
||||
}
|
||||
@@ -3748,7 +3753,7 @@ static s32 ixgbe_read_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,
|
||||
s32 status;
|
||||
|
||||
if (hw->mac.ops.acquire_swfw_sync(hw, mask))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
status = hw->phy.ops.read_reg_mdi(hw, reg_addr, device_type, phy_data);
|
||||
|
||||
@@ -3774,7 +3779,7 @@ static s32 ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,
|
||||
s32 status;
|
||||
|
||||
if (hw->mac.ops.acquire_swfw_sync(hw, mask))
|
||||
return IXGBE_ERR_SWFW_SYNC;
|
||||
return -EBUSY;
|
||||
|
||||
status = ixgbe_write_phy_reg_mdi(hw, reg_addr, device_type, phy_data);
|
||||
hw->mac.ops.release_swfw_sync(hw, mask);
|
||||
|
||||
@@ -227,11 +227,13 @@ static int arfs_create_groups(struct mlx5e_flow_table *ft,
|
||||
|
||||
ft->g = kcalloc(MLX5E_ARFS_NUM_GROUPS,
|
||||
sizeof(*ft->g), GFP_KERNEL);
|
||||
in = kvzalloc(inlen, GFP_KERNEL);
|
||||
if (!in || !ft->g) {
|
||||
kvfree(ft->g);
|
||||
kvfree(in);
|
||||
if (!ft->g)
|
||||
return -ENOMEM;
|
||||
|
||||
in = kvzalloc(inlen, GFP_KERNEL);
|
||||
if (!in) {
|
||||
err = -ENOMEM;
|
||||
goto err_free_g;
|
||||
}
|
||||
|
||||
mc = MLX5_ADDR_OF(create_flow_group_in, in, match_criteria);
|
||||
@@ -251,7 +253,7 @@ static int arfs_create_groups(struct mlx5e_flow_table *ft,
|
||||
break;
|
||||
default:
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
goto err_free_in;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
@@ -273,7 +275,7 @@ static int arfs_create_groups(struct mlx5e_flow_table *ft,
|
||||
break;
|
||||
default:
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
goto err_free_in;
|
||||
}
|
||||
|
||||
MLX5_SET_CFG(in, match_criteria_enable, MLX5_MATCH_OUTER_HEADERS);
|
||||
@@ -282,7 +284,7 @@ static int arfs_create_groups(struct mlx5e_flow_table *ft,
|
||||
MLX5_SET_CFG(in, end_flow_index, ix - 1);
|
||||
ft->g[ft->num_groups] = mlx5_create_flow_group(ft->t, in);
|
||||
if (IS_ERR(ft->g[ft->num_groups]))
|
||||
goto err;
|
||||
goto err_clean_group;
|
||||
ft->num_groups++;
|
||||
|
||||
memset(in, 0, inlen);
|
||||
@@ -291,18 +293,20 @@ static int arfs_create_groups(struct mlx5e_flow_table *ft,
|
||||
MLX5_SET_CFG(in, end_flow_index, ix - 1);
|
||||
ft->g[ft->num_groups] = mlx5_create_flow_group(ft->t, in);
|
||||
if (IS_ERR(ft->g[ft->num_groups]))
|
||||
goto err;
|
||||
goto err_clean_group;
|
||||
ft->num_groups++;
|
||||
|
||||
kvfree(in);
|
||||
return 0;
|
||||
|
||||
err:
|
||||
err_clean_group:
|
||||
err = PTR_ERR(ft->g[ft->num_groups]);
|
||||
ft->g[ft->num_groups] = NULL;
|
||||
out:
|
||||
err_free_in:
|
||||
kvfree(in);
|
||||
|
||||
err_free_g:
|
||||
kfree(ft->g);
|
||||
ft->g = NULL;
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -571,11 +571,13 @@ static int enable_bars(struct nfp6000_pcie *nfp, u16 interface)
|
||||
const u32 barcfg_msix_general =
|
||||
NFP_PCIE_BAR_PCIE2CPP_MapType(
|
||||
NFP_PCIE_BAR_PCIE2CPP_MapType_GENERAL) |
|
||||
NFP_PCIE_BAR_PCIE2CPP_LengthSelect_32BIT;
|
||||
NFP_PCIE_BAR_PCIE2CPP_LengthSelect(
|
||||
NFP_PCIE_BAR_PCIE2CPP_LengthSelect_32BIT);
|
||||
const u32 barcfg_msix_xpb =
|
||||
NFP_PCIE_BAR_PCIE2CPP_MapType(
|
||||
NFP_PCIE_BAR_PCIE2CPP_MapType_BULK) |
|
||||
NFP_PCIE_BAR_PCIE2CPP_LengthSelect_32BIT |
|
||||
NFP_PCIE_BAR_PCIE2CPP_LengthSelect(
|
||||
NFP_PCIE_BAR_PCIE2CPP_LengthSelect_32BIT) |
|
||||
NFP_PCIE_BAR_PCIE2CPP_Target_BaseAddress(
|
||||
NFP_CPP_TARGET_ISLAND_XPB);
|
||||
const u32 barcfg_explicit[4] = {
|
||||
|
||||
@@ -235,21 +235,25 @@ static int fjes_hw_setup(struct fjes_hw *hw)
|
||||
|
||||
mem_size = FJES_DEV_REQ_BUF_SIZE(hw->max_epid);
|
||||
hw->hw_info.req_buf = kzalloc(mem_size, GFP_KERNEL);
|
||||
if (!(hw->hw_info.req_buf))
|
||||
return -ENOMEM;
|
||||
if (!(hw->hw_info.req_buf)) {
|
||||
result = -ENOMEM;
|
||||
goto free_ep_info;
|
||||
}
|
||||
|
||||
hw->hw_info.req_buf_size = mem_size;
|
||||
|
||||
mem_size = FJES_DEV_RES_BUF_SIZE(hw->max_epid);
|
||||
hw->hw_info.res_buf = kzalloc(mem_size, GFP_KERNEL);
|
||||
if (!(hw->hw_info.res_buf))
|
||||
return -ENOMEM;
|
||||
if (!(hw->hw_info.res_buf)) {
|
||||
result = -ENOMEM;
|
||||
goto free_req_buf;
|
||||
}
|
||||
|
||||
hw->hw_info.res_buf_size = mem_size;
|
||||
|
||||
result = fjes_hw_alloc_shared_status_region(hw);
|
||||
if (result)
|
||||
return result;
|
||||
goto free_res_buf;
|
||||
|
||||
hw->hw_info.buffer_share_bit = 0;
|
||||
hw->hw_info.buffer_unshare_reserve_bit = 0;
|
||||
@@ -260,11 +264,11 @@ static int fjes_hw_setup(struct fjes_hw *hw)
|
||||
|
||||
result = fjes_hw_alloc_epbuf(&buf_pair->tx);
|
||||
if (result)
|
||||
return result;
|
||||
goto free_epbuf;
|
||||
|
||||
result = fjes_hw_alloc_epbuf(&buf_pair->rx);
|
||||
if (result)
|
||||
return result;
|
||||
goto free_epbuf;
|
||||
|
||||
spin_lock_irqsave(&hw->rx_status_lock, flags);
|
||||
fjes_hw_setup_epbuf(&buf_pair->tx, mac,
|
||||
@@ -287,6 +291,25 @@ static int fjes_hw_setup(struct fjes_hw *hw)
|
||||
fjes_hw_init_command_registers(hw, ¶m);
|
||||
|
||||
return 0;
|
||||
|
||||
free_epbuf:
|
||||
for (epidx = 0; epidx < hw->max_epid ; epidx++) {
|
||||
if (epidx == hw->my_epid)
|
||||
continue;
|
||||
fjes_hw_free_epbuf(&hw->ep_shm_info[epidx].tx);
|
||||
fjes_hw_free_epbuf(&hw->ep_shm_info[epidx].rx);
|
||||
}
|
||||
fjes_hw_free_shared_status_region(hw);
|
||||
free_res_buf:
|
||||
kfree(hw->hw_info.res_buf);
|
||||
hw->hw_info.res_buf = NULL;
|
||||
free_req_buf:
|
||||
kfree(hw->hw_info.req_buf);
|
||||
hw->hw_info.req_buf = NULL;
|
||||
free_ep_info:
|
||||
kfree(hw->ep_shm_info);
|
||||
hw->ep_shm_info = NULL;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void fjes_hw_cleanup(struct fjes_hw *hw)
|
||||
|
||||
@@ -474,6 +474,10 @@ ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
|
||||
case PPPIOCSMRU:
|
||||
if (get_user(val, p))
|
||||
break;
|
||||
if (val > U16_MAX) {
|
||||
err = -EINVAL;
|
||||
break;
|
||||
}
|
||||
if (val < PPP_MRU)
|
||||
val = PPP_MRU;
|
||||
ap->mru = val;
|
||||
|
||||
@@ -2727,10 +2727,11 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
|
||||
{
|
||||
vq_callback_t **callbacks;
|
||||
struct virtqueue **vqs;
|
||||
int ret = -ENOMEM;
|
||||
int i, total_vqs;
|
||||
const char **names;
|
||||
int ret = -ENOMEM;
|
||||
int total_vqs;
|
||||
bool *ctx;
|
||||
u16 i;
|
||||
|
||||
/* We expect 1 RX virtqueue followed by 1 TX virtqueue, followed by
|
||||
* possible N-1 RX/TX queue pairs used in multiqueue mode, followed by
|
||||
@@ -2767,8 +2768,8 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
|
||||
for (i = 0; i < vi->max_queue_pairs; i++) {
|
||||
callbacks[rxq2vq(i)] = skb_recv_done;
|
||||
callbacks[txq2vq(i)] = skb_xmit_done;
|
||||
sprintf(vi->rq[i].name, "input.%d", i);
|
||||
sprintf(vi->sq[i].name, "output.%d", i);
|
||||
sprintf(vi->rq[i].name, "input.%u", i);
|
||||
sprintf(vi->sq[i].name, "output.%u", i);
|
||||
names[rxq2vq(i)] = vi->rq[i].name;
|
||||
names[txq2vq(i)] = vi->sq[i].name;
|
||||
if (ctx)
|
||||
|
||||
@@ -103,17 +103,13 @@ __be16 lmc_proto_type(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/
|
||||
switch(sc->if_type){
|
||||
case LMC_PPP:
|
||||
return hdlc_type_trans(skb, sc->lmc_device);
|
||||
break;
|
||||
case LMC_NET:
|
||||
return htons(ETH_P_802_2);
|
||||
break;
|
||||
case LMC_RAW: /* Packet type for skbuff kind of useless */
|
||||
return htons(ETH_P_802_2);
|
||||
break;
|
||||
default:
|
||||
printk(KERN_WARNING "%s: No protocol set for this interface, assuming 802.2 (which is wrong!!)\n", sc->name);
|
||||
return htons(ETH_P_802_2);
|
||||
break;
|
||||
}
|
||||
lmc_trace(sc->lmc_device, "lmc_proto_tye out");
|
||||
|
||||
|
||||
@@ -647,9 +647,10 @@ void ath9k_htc_txstatus(struct ath9k_htc_priv *priv, void *wmi_event)
|
||||
struct ath9k_htc_tx_event *tx_pend;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < txs->cnt; i++) {
|
||||
WARN_ON(txs->cnt > HTC_MAX_TX_STATUS);
|
||||
if (WARN_ON_ONCE(txs->cnt > HTC_MAX_TX_STATUS))
|
||||
return;
|
||||
|
||||
for (i = 0; i < txs->cnt; i++) {
|
||||
__txs = &txs->txstatus[i];
|
||||
|
||||
skb = ath9k_htc_tx_get_packet(priv, __txs);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user