[PATCH net-next v2 3/3] net: phy: marvell-88x2222: swap 1G/10G modes on autoneg

2021-04-13 Thread Ivan Bornyakov
to be established. And vice versa. If 10GBase-R link can't be established for quite a time, and autonegotiation is enabled, and there is signal in line, switch line interface type to appropriate 1G mode, i.e. 1000Base-X or SGMII, if supported. Signed-off-by: Ivan Bornyakov --- drivers/net/phy

[PATCH net-next v2 0/3] net: phy: marvell-88x2222: a couple of improvements

2021-04-13 Thread Ivan Bornyakov
its for the sake of easier review. Ivan Bornyakov (3): net: phy: marvell-88x: check that link is operational net: phy: marvell-88x: move read_status after config_aneg net: phy: marvell-88x: swap 1G/10G modes on autoneg drivers/net/phy/marvell-88x.c | 314 --

[PATCH net-next v2 2/3] net: phy: marvell-88x2222: move read_status after config_aneg

2021-04-13 Thread Ivan Bornyakov
No functional changes, just move read link status routines below autonegotiation configuration to make future functional changes more distinct. Signed-off-by: Ivan Bornyakov --- drivers/net/phy/marvell-88x.c | 196 +++--- 1 file changed, 98 insertions(+), 98

[PATCH net-next v2 1/3] net: phy: marvell-88x2222: check that link is operational

2021-04-13 Thread Ivan Bornyakov
to the tranciever, check only PMD Recieve Signal Detect register. Signed-off-by: Ivan Bornyakov --- drivers/net/phy/marvell-88x.c | 43 +++ 1 file changed, 43 insertions(+) diff --git a/drivers/net/phy/marvell-88x.c b/drivers/net/phy/marvell-88x.c index

Re: [PATCH net-next 1/2] net: phy: marvell-88x2222: check that link is operational

2021-04-13 Thread Ivan Bornyakov
On Tue, Apr 13, 2021 at 10:23:48AM +0100, Russell King - ARM Linux admin wrote: > On Tue, Apr 13, 2021 at 10:19:30AM +0300, Ivan Bornyakov wrote: > > On Tue, Apr 13, 2021 at 01:40:32AM +0200, Andrew Lunn wrote: > > > On Mon, Apr 12, 2021 at 03:16:59PM +0300, Ivan Bornyakov wrote

Re: [PATCH net-next 1/2] net: phy: marvell-88x2222: check that link is operational

2021-04-13 Thread Ivan Bornyakov
On Tue, Apr 13, 2021 at 01:40:32AM +0200, Andrew Lunn wrote: > On Mon, Apr 12, 2021 at 03:16:59PM +0300, Ivan Bornyakov wrote: > > Some SFP modules uses RX_LOS for link indication. In such cases link > > will be always up, even without cable connected. RX_LOS changes will >

Re: [PATCH net-next 1/2] net: phy: marvell-88x2222: check that link is operational

2021-04-13 Thread Ivan Bornyakov
On Tue, Apr 13, 2021 at 01:32:12AM +0200, Marek BehĂșn wrote: > On Mon, 12 Apr 2021 15:16:59 +0300 > Ivan Bornyakov wrote: > > > Some SFP modules uses RX_LOS for link indication. In such cases link > > will be always up, even without cable connected. RX_LOS changes wil

[PATCH net-next 2/2] net: phy: marvell-88x2222: swap 1G/10G modes on autoneg

2021-04-12 Thread Ivan Bornyakov
-by: Ivan Bornyakov --- drivers/net/phy/marvell-88x.c | 276 ++ 1 file changed, 168 insertions(+), 108 deletions(-) diff --git a/drivers/net/phy/marvell-88x.c b/drivers/net/phy/marvell-88x.c index fb285ac741b2..d16c81f08334 100644 --- a/drivers/net/phy/marvell

[PATCH net-next 0/2] net: phy: marvell-88x2222: a couple of improvements

2021-04-12 Thread Ivan Bornyakov
and 1000Base-X/SGMII if autonegotiation can't complete but there is signal in line. Ivan Bornyakov (2): net: phy: marvell-88x: check that link is operational net: phy: marvell-88x: swap 1G/10G modes on autoneg drivers/net/phy/marvell-88x.c | 296 +++--- 1

[PATCH net-next 1/2] net: phy: marvell-88x2222: check that link is operational

2021-04-12 Thread Ivan Bornyakov
Some SFP modules uses RX_LOS for link indication. In such cases link will be always up, even without cable connected. RX_LOS changes will trigger link_up()/link_down() upstream operations. Thus, check that SFP link is operational before actual read link status. Signed-off-by: Ivan Bornyakov

[RESEND PATCH v4 net-next] net: phy: add Marvell 88X2222 transceiver support

2021-03-15 Thread Ivan Bornyakov
. Signed-off-by: Ivan Bornyakov --- drivers/net/phy/Kconfig | 6 + drivers/net/phy/Makefile | 1 + drivers/net/phy/marvell-88x.c | 519 ++ include/linux/marvell_phy.h | 1 + 4 files changed, 527 insertions(+) create mode 100644 drivers

Re: [PATCH v4] net: phy: add Marvell 88X2222 transceiver support

2021-03-10 Thread Ivan Bornyakov
On Wed, Mar 03, 2021 at 07:02:11PM +0300, Ivan Bornyakov wrote: > Add basic support for the Marvell 88X multi-speed ethernet > transceiver. > > This PHY provides data transmission over fiber-optic as well as Twinax > copper links. The 88X supports 2 ports of 10GBase-R

[PATCH v4] net: phy: add Marvell 88X2222 transceiver support

2021-03-03 Thread Ivan Bornyakov
. Signed-off-by: Ivan Bornyakov --- drivers/net/phy/Kconfig | 6 + drivers/net/phy/Makefile | 1 + drivers/net/phy/marvell-88x.c | 519 ++ include/linux/marvell_phy.h | 1 + 4 files changed, 527 insertions(+) create mode 100644 drivers

Re: [PATCH v3] net: phy: add Marvell 88X2222 transceiver support

2021-03-03 Thread Ivan Bornyakov
On Wed, Mar 03, 2021 at 11:36:55AM +, Russell King - ARM Linux admin wrote: > > > + linkmode_set_bit(ETHTOOL_LINK_MODE_1baseKR_Full_BIT, supported); > > Does the PHY support backplane links? > It looks like it does, but our hardware only have SFP cages, so I'll drop backplane link

[PATCH v3] net: phy: add Marvell 88X2222 transceiver support

2021-03-03 Thread Ivan Bornyakov
. Signed-off-by: Ivan Bornyakov --- drivers/net/phy/Kconfig | 6 + drivers/net/phy/Makefile | 1 + drivers/net/phy/marvell-88x.c | 533 ++ include/linux/marvell_phy.h | 1 + 4 files changed, 541 insertions(+) create mode 100644 drivers

Re: [PATCH v2] net: phy: add Marvell 88X2222 transceiver support

2021-02-20 Thread Ivan Bornyakov
On Sat, Feb 20, 2021 at 11:53:04AM +, Russell King - ARM Linux admin wrote: > On Sat, Feb 20, 2021 at 12:46:23PM +0300, Ivan Bornyakov wrote: > > + > > + switch (sfp_interface) { > > + case PHY_INTERFACE_MODE_10GBASER: > > +

[PATCH v2] net: phy: add Marvell 88X2222 transceiver support

2021-02-20 Thread Ivan Bornyakov
. Signed-off-by: Ivan Bornyakov --- drivers/net/phy/Kconfig | 6 + drivers/net/phy/Makefile | 1 + drivers/net/phy/marvell-88x.c | 510 ++ include/linux/marvell_phy.h | 1 + 4 files changed, 518 insertions(+) create mode 100644 drivers

Re: [PATCH] net: phy: add Marvell 88X2222 transceiver support

2021-02-02 Thread Ivan Bornyakov
On Tue, Feb 02, 2021 at 04:48:01PM +, Russell King - ARM Linux admin wrote: > On Mon, Feb 01, 2021 at 10:22:51PM +0300, Ivan Bornyakov wrote: > > +/* PMD Transmit Disable */ > > +#defineMV_TX_DISABLE 0x0009 > > +#defineMV_TX_DISABLE_GLOBALB

Re: [PATCH] net: phy: add Marvell 88X2222 transceiver support

2021-02-02 Thread Ivan Bornyakov
On Mon, Feb 01, 2021 at 11:56:01PM +0100, Andrew Lunn wrote: > > +static int mv_config_init(struct phy_device *phydev) > > +{ > > + linkmode_zero(phydev->supported); > > + linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, phydev->supported); > > +

[PATCH] net: phy: add Marvell 88X2222 transceiver support

2021-02-01 Thread Ivan Bornyakov
-R, RXAUI, 1000Base-X and 2 ports of XAUI. This driver, however, supports only XAUI on the host-side and 1000Base-X/10GBase-R on the line-side, for now. Interrupts are not supported also. Internal registers access compliant with the Clause 45 specification. Signed-off-by: Ivan Bornyakov

[PATCH] staging: gasket: apex: fix copy-paste typo

2019-07-10 Thread Ivan Bornyakov
In sysfs_show() case-branches ATTR_KERNEL_HIB_PAGE_TABLE_SIZE and ATTR_KERNEL_HIB_SIMPLE_PAGE_TABLE_SIZE do the same. It looks like copy-paste mistake. Signed-off-by: Ivan Bornyakov --- drivers/staging/gasket/apex_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2] staging: gasket: sysfs: fix potential null dereference

2018-08-01 Thread Ivan Bornyakov
Add handling of possible allocation failure. Reported by smatch: drivers/staging/gasket/gasket_sysfs.c:105 put_mapping() error: potential null dereference 'files_to_remove'. (kcalloc returns null) Signed-off-by: Ivan Bornyakov --- drivers/staging/gasket/gasket_sysfs.c | 5 + 1 file

[PATCH v2] staging: gasket: sysfs: fix potential null dereference

2018-08-01 Thread Ivan Bornyakov
Add handling of possible allocation failure. Reported by smatch: drivers/staging/gasket/gasket_sysfs.c:105 put_mapping() error: potential null dereference 'files_to_remove'. (kcalloc returns null) Signed-off-by: Ivan Bornyakov --- drivers/staging/gasket/gasket_sysfs.c | 5 + 1 file

[PATCH] staging: gasket: sysfs: fix potential null dereference

2018-07-31 Thread Ivan Bornyakov
Add handling of possible allocation failure. Reported by smatch: drivers/staging/gasket/gasket_sysfs.c:105 put_mapping() error: potential null dereference 'files_to_remove'. (kcalloc returns null) Signed-off-by: Ivan Bornyakov --- drivers/staging/gasket/gasket_sysfs.c | 6 ++ 1 file

[PATCH] staging: gasket: sysfs: fix potential null dereference

2018-07-31 Thread Ivan Bornyakov
Add handling of possible allocation failure. Reported by smatch: drivers/staging/gasket/gasket_sysfs.c:105 put_mapping() error: potential null dereference 'files_to_remove'. (kcalloc returns null) Signed-off-by: Ivan Bornyakov --- drivers/staging/gasket/gasket_sysfs.c | 6 ++ 1 file

[PATCH v2] staging: gasket: use vzalloc instead of vmalloc/memset

2018-07-23 Thread Ivan Bornyakov
Use vzalloc instead of vmalloc followed by memset with 0. Signed-off-by: Ivan Bornyakov --- drivers/staging/gasket/gasket_page_table.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket

[PATCH v2] staging: gasket: use vzalloc instead of vmalloc/memset

2018-07-23 Thread Ivan Bornyakov
Use vzalloc instead of vmalloc followed by memset with 0. Signed-off-by: Ivan Bornyakov --- drivers/staging/gasket/gasket_page_table.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket

[PATCH] staging: gasket: use vzalloc instead of vmalloc/memset

2018-07-23 Thread Ivan Bornyakov
Signed-off-by: Ivan Bornyakov --- drivers/staging/gasket/gasket_page_table.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket/gasket_page_table.c index 9f8116112e0a..3ffc8d67ec05 100644 --- a/drivers

[PATCH] staging: gasket: use vzalloc instead of vmalloc/memset

2018-07-23 Thread Ivan Bornyakov
Signed-off-by: Ivan Bornyakov --- drivers/staging/gasket/gasket_page_table.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket/gasket_page_table.c index 9f8116112e0a..3ffc8d67ec05 100644 --- a/drivers

[PATCH] staging: gasket: fix plain integer as NULL pointer warning

2018-07-11 Thread Ivan Bornyakov
: warning: Using plain integer as NULL pointer Signed-off-by: Ivan Bornyakov --- drivers/staging/gasket/gasket_page_table.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket/gasket_page_table.c index

[PATCH] staging: gasket: fix plain integer as NULL pointer warning

2018-07-11 Thread Ivan Bornyakov
: warning: Using plain integer as NULL pointer Signed-off-by: Ivan Bornyakov --- drivers/staging/gasket/gasket_page_table.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket/gasket_page_table.c index

[PATCH] atm: zatm: fix memcmp casting

2018-05-25 Thread Ivan Bornyakov
memcmp() returns int, but eprom_try_esi() cast it to unsigned char. One can lose significant bits and get 0 from non-0 value returned by the memcmp(). Signed-off-by: Ivan Bornyakov <brnkv...@gmail.com> --- drivers/atm/zatm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH] atm: zatm: fix memcmp casting

2018-05-25 Thread Ivan Bornyakov
memcmp() returns int, but eprom_try_esi() cast it to unsigned char. One can lose significant bits and get 0 from non-0 value returned by the memcmp(). Signed-off-by: Ivan Bornyakov --- drivers/atm/zatm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/atm/zatm.c

[PATCH] scsi: isci: fix memcmp casting

2018-05-24 Thread Ivan Bornyakov
memcmp() returns int, but variable of type u8 is used to store it. When casting int to u8, one can lose significant bits and get 0 from non-0 value returned by the memcmp(). Signed-off-by: Ivan Bornyakov <brnkv...@gmail.com> --- drivers/scsi/isci/host.c | 4 ++-- 1 file changed, 2 inse

[PATCH] scsi: isci: fix memcmp casting

2018-05-24 Thread Ivan Bornyakov
memcmp() returns int, but variable of type u8 is used to store it. When casting int to u8, one can lose significant bits and get 0 from non-0 value returned by the memcmp(). Signed-off-by: Ivan Bornyakov --- drivers/scsi/isci/host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH] nvme: host: core: fix precedence of ternary operator

2018-05-23 Thread Ivan Bornyakov
Ternary operator have lower precedence then bitwise or, so 'cdw10' was calculated wrong. Signed-off-by: Ivan Bornyakov <brnkv...@gmail.com> --- drivers/nvme/host/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/

[PATCH] nvme: host: core: fix precedence of ternary operator

2018-05-23 Thread Ivan Bornyakov
Ternary operator have lower precedence then bitwise or, so 'cdw10' was calculated wrong. Signed-off-by: Ivan Bornyakov --- drivers/nvme/host/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index b070c659391f

[PATCH] staging: lustre: libcfs: add parens around macros args

2018-05-22 Thread Ivan Bornyakov
One may call 'CFS_FAIL_TIMEOUT(id, secs + 5);' and get unexpected result after macro substitution, viz., 'secs + 5' will turn into 'secs + 5 * 1000' Signed-off-by: Ivan Bornyakov <brnkv...@gmail.com> --- drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h | 6 +++--- 1 file chan

[PATCH] staging: lustre: libcfs: add parens around macros args

2018-05-22 Thread Ivan Bornyakov
One may call 'CFS_FAIL_TIMEOUT(id, secs + 5);' and get unexpected result after macro substitution, viz., 'secs + 5' will turn into 'secs + 5 * 1000' Signed-off-by: Ivan Bornyakov --- drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h | 6 +++--- 1 file changed, 3 insertions(+), 3