netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Tantilov, Emil S" <emil.s.tantilov@intel.com>
To: Ben Hutchings <bhutchings@solarflare.com>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"gospo@redhat.com" <gospo@redhat.com>,
	"sassmann@redhat.com" <sassmann@redhat.com>
Subject: RE: [net-next 07/15] ixgbe: fix SFF data dumps of SFP+ modules
Date: Tue, 6 Aug 2013 00:56:10 +0000	[thread overview]
Message-ID: <87618083B2453E4A8714035B62D679924FDEDF40@FMSMSX105.amr.corp.intel.com> (raw)
In-Reply-To: <1375434517.24371.24.camel@deadeye.wl.decadent.org.uk>

>-----Original Message-----
>From: netdev-owner@vger.kernel.org [mailto:netdev-
>owner@vger.kernel.org] On Behalf Of Ben Hutchings
>Sent: Friday, August 02, 2013 2:09 AM
>To: Kirsher, Jeffrey T
>Cc: davem@davemloft.net; Tantilov, Emil S;
>netdev@vger.kernel.org; gospo@redhat.com;
>sassmann@redhat.com
>Subject: Re: [net-next 07/15] ixgbe: fix SFF data dumps of
>SFP+ modules
>
>On Mon, 2013-07-29 at 05:52 -0700, Jeff Kirsher wrote:
>> From: Emil Tantilov <emil.s.tantilov@intel.com>
>>
>> This patch fixes several issues with the previous
>implementation of the
>> SFF data dump of SFP+ modules:
>>
>> - removed the __IXGBE_READ_I2C flag - I2C access locking
>is handled in the
>>   HW specific routines
>>
>> - fixed the read loop to read data from ee->offset to ee-
>>len
>>
>> - the reads fail if __IXGBE_IN_SFP_INIT is set in the
>process - this is
>>   needed because on some HW I2C operations can take long
>time and disrupt
>>   the SFP and link detection process
>>
>> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
>> Reported-by: Ben Hutchings <bhutchings@solarflare.com>
>> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>[...]
>> @@ -2969,48 +2955,25 @@ static int
>ixgbe_get_module_eeprom(struct net_device *dev,
>>  	int i = 0;
>>  	int ret_val = 0;
>>
>> -	/* ixgbe_get_module_info is called before this function
>in all
>> -	 * cases, so we do not need any checks we already do
>above,
>> -	 * and can trust ee->len to be a known value.
>> -	 */
>> +	if (ee->len == 0)
>> +		return -EINVAL;
>>
>> -	while (test_bit(__IXGBE_IN_SFP_INIT, &adapter->state))
>> -		msleep(100);
>> -	set_bit(__IXGBE_READ_I2C, &adapter->state);
>> +	for (i = ee->offset; i < ee->len; i++) {
>
>                               i < ee->offset + ee->len
>
>> +		/* I2C reads can take long time */
>> +		if (test_bit(__IXGBE_IN_SFP_INIT, &adapter-
>>state))
>> +			return -EBUSY;
>>
>> -	/* Read the first block, SFF-8079 */
>> -	for (i = 0; i < ETH_MODULE_SFF_8079_LEN; i++) {
>> -		status = hw->phy.ops.read_i2c_eeprom(hw, i,
>&databyte);
>> -		if (status != 0) {
>> -			/* Error occured while reading module */
>> +		if (i < ETH_MODULE_SFF_8079_LEN)
>> +			status  = hw->phy.ops.read_i2c_eeprom(hw, i,
>&databyte);
>> +		else
>> +			status = hw->phy.ops.read_i2c_sff8472(hw, i,
>&databyte);
>[...]
>                                                     i -
>ETH_MODULE_SFF_8079_LEN ?
>
>But this works anyway because the address is truncated to
>u8.

Actually as is the loop will only work when offset is 0, so it looks like it should be:

for (i = ee->offset; i < ee->offset + ee->len; i++) {


Unless you had something else in mind.

I will submit a fix for this.

Thanks,
Emil

>
>Ben.


  reply	other threads:[~2013-08-06  0:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-29 12:51 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2013-07-29 12:51 ` [net-next 01/15] ixgbe: Retain VLAN filtering in promiscuous + VT mode Jeff Kirsher
2013-07-29 12:51 ` [net-next 02/15] ixgbe: Use pci_vfs_assigned instead of ixgbe_vfs_are_assigned Jeff Kirsher
2013-07-29 12:51 ` [net-next 03/15] ixgbe: fix fc autoneg ethtool reporting Jeff Kirsher
2013-07-30  5:18   ` David Miller
2013-07-30 16:17     ` Skidmore, Donald C
2013-07-29 12:52 ` [net-next 04/15] ixgbe: add new media type Jeff Kirsher
2013-07-30  5:20   ` David Miller
2013-07-29 12:52 ` [net-next 05/15] ixgbe: bump version number Jeff Kirsher
2013-07-29 12:52 ` [net-next 06/15] ixgbe: fix semaphore lock for I2C read/writes on 82598 Jeff Kirsher
2013-07-29 12:52 ` [net-next 07/15] ixgbe: fix SFF data dumps of SFP+ modules Jeff Kirsher
2013-08-02  9:08   ` Ben Hutchings
2013-08-06  0:56     ` Tantilov, Emil S [this message]
2013-07-29 12:52 ` [net-next 08/15] pci: expose pcie_link_speed and pcix_bus_speed arrays Jeff Kirsher
2013-07-29 18:44   ` Bjorn Helgaas
2013-07-29 21:03     ` Keller, Jacob E
2013-07-29 21:19       ` Bjorn Helgaas
2013-07-29 12:52 ` [net-next 09/15] pci: move enum pcie_link_width into pci.h Jeff Kirsher
2013-07-29 18:39   ` Bjorn Helgaas
2013-07-29 12:52 ` [net-next 10/15] pci: Add function to obtain minimum link width and speed Jeff Kirsher
2013-07-29 18:45   ` Bjorn Helgaas
2013-07-29 12:52 ` [net-next 11/15] ixgbe: call pcie_get_mimimum_link to check if device has enough bandwidth Jeff Kirsher
2013-07-29 21:46   ` Keller, Jacob E
2013-07-29 12:52 ` [net-next 12/15] ixgbe: fix lockdep annotation issue for ptp's work item Jeff Kirsher
2013-07-29 12:52 ` [net-next 13/15] ixgbe: rename LL_EXTENDED_STATS to use queue instead of q Jeff Kirsher
2013-07-29 12:52 ` [net-next 14/15] ixgbe: clear semaphore bits on timeouts Jeff Kirsher
2013-07-29 12:52 ` [net-next 15/15] ixgbe: add support for quad-port x520 adapter Jeff Kirsher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87618083B2453E4A8714035B62D679924FDEDF40@FMSMSX105.amr.corp.intel.com \
    --to=emil.s.tantilov@intel.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).