All of lore.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Jack Morgenstein
	<jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Yevgeny Petrilin
	<yevgenyp-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
Subject: Re: [PATCH] mlx4_core: Fix crash on uninitialized priv->cmd.slave_sem
Date: Thu, 27 Sep 2012 14:35:20 +0200	[thread overview]
Message-ID: <50644808.8020101@mellanox.com> (raw)
In-Reply-To: <CAG4TOxPBOMQW1XeB-CNjq+RHix3Rk-ZqfB_6d5YscMQKDOumtA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 27/09/2012 08:46, Roland Dreier wrote:
> On Wed, Sep 26, 2012 at 2:51 PM, Or Gerlitz <or.gerlitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> What exactly did you mean by saying "for unlucky configurations"
>> above? what value did you use for mlx4_core's port_array_type module
>> param?
> I didn't set the parameter at all.  What I meant by "unlucky configs" was
> all the conditions in the following code in mlx4_dev_cap():
>
> 		/*
> 		 * Link sensing is allowed on the port if 3 conditions are true:
> 		 * 1. Both protocols are supported on the port.
> 		 * 2. Different types are supported on the port
> 		 * 3. FW declared that it supports link sensing
> 		 */
> 		mlx4_priv(dev)->sense.sense_allowed[i] =
> 			((dev->caps.supported_type[i] == MLX4_PORT_TYPE_AUTO) &&
> 			 (dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP) &&
> 			 (dev->caps.flags & MLX4_DEV_CAP_FLAG_SENSE_SUPPORT));
>
> 		/*
> 		 * If "default_sense" bit is set, we move the port to "AUTO" mode
> 		 * and perform sense_port FW command to try and set the correct
> 		 * port type from beginning
> 		 */
> 		if (mlx4_priv(dev)->sense.sense_allowed[i] && dev->caps.default_sense[i]) {
> 			enum mlx4_port_type sensed_port = MLX4_PORT_TYPE_NONE;
> 			dev->caps.possible_type[i] = MLX4_PORT_TYPE_AUTO;
> 			mlx4_SENSE_PORT(dev, i, &sensed_port);
> 			if (sensed_port != MLX4_PORT_TYPE_NONE)
> 				dev->caps.port_type[i] = sensed_port;
> 		} else {

Roland,

Looking deeper on the issues you reported, we noted that the bug is up 
here on the RHS of

if (mlx4_priv(dev)->sense.sense_allowed[i] && dev->caps.default_sense[i])

as when a firmware sets the “do_sense” bit as 1 (which is the default in 
2.11.0500), the driver begins to do sensing. This firmware somehow went 
out without enough mfunc checking, bad. A fast solution would be a one 
liner patch that forces the LHS of this line to be false under mfunc 
mode, that is add forth condition to the three conditions above which is 
&& !mfunc

In the overall driver architecture level, auto-sending can/will be abled 
in later state, when the PPF
can signal the VFs to reset/re-create their mlx4 device when the link 
type change, as done in native
mode.

Or.



> I'm beginning to think it might be that I had nothing hooked up
> to my adapter initially, which seems to lead to the fatal SENSE_PORT
> call here.  I notice that once I bring up the link, the stream of failing
> SENSE_PORT calls (which don't ever work in SR-IOV mode AFAICT) stops as well.
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2012-09-27 12:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26  4:42 [PATCH] mlx4_core: Fix crash on uninitialized priv->cmd.slave_sem Roland Dreier
     [not found] ` <1348634552-21047-1-git-send-email-roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2012-09-26  4:46   ` Roland Dreier
     [not found]     ` <CAL1RGDUm4Zxnoby5O2RkoahbPUtYBL5UPxAFiwDnNNv4pdy7vA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-26 17:01       ` Roland Dreier
2012-09-26 21:51   ` Or Gerlitz
     [not found]     ` <CAJZOPZKoMorYPBqUPbmUcsw1GcXOYo8oE-u2gA6HB6sb3eo1iw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-27  6:46       ` Roland Dreier
     [not found]         ` <CAG4TOxPBOMQW1XeB-CNjq+RHix3Rk-ZqfB_6d5YscMQKDOumtA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-27  7:57           ` Or Gerlitz
     [not found]             ` <CAG4TOxPCVuyEUMO01PCUyav+18vMDqN85iSAKc3NWnS3L4PnyQ@mail.gmail.com>
     [not found]               ` <CAG4TOxPCVuyEUMO01PCUyav+18vMDqN85iSAKc3NWnS3L4PnyQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-27  8:22                 ` Or Gerlitz
2012-09-27 12:35           ` Or Gerlitz [this message]
2012-10-02  8:51   ` Jack Morgenstein

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=50644808.8020101@mellanox.com \
    --to=ogerlitz-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=yevgenyp-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.