From: Jason Gunthorpe <jgg@mellanox.com>
To: Saeed Mahameed <saeedm@dev.mellanox.co.il>
Cc: Leon Romanovsky <leonro@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
Maxim Mikityanskiy <maximmi@mellanox.com>,
Eran Ben Elisha <eranbe@mellanox.com>
Subject: Re: [PATCH mlx5-next 4/4] net/mlx5: Remove spinlock support from mlx5_write64
Date: Mon, 21 Jan 2019 18:22:08 +0000 [thread overview]
Message-ID: <20190121182200.GI25149@mellanox.com> (raw)
In-Reply-To: <CALzJLG9Lr4VcOpYLXKNHmHLzjxDCMN6AvaTRjW7ZZEMukPdZ4w@mail.gmail.com>
On Mon, Jan 21, 2019 at 10:12:58AM -0800, Saeed Mahameed wrote:
> On Mon, Jan 21, 2019 at 8:46 AM Jason Gunthorpe <jgg@mellanox.com> wrote:
> >
> > On Sat, Jan 19, 2019 at 12:43:14AM -0700, Leon Romanovsky wrote:
> > > You need to do one of two things:
> > > 1. Require CONFIG_64BIT and delete this 32bit code.
> > > 2. Declare global mlx5 DB spinlock and use on 32bit systems, something
> > > like this:
> > > #if BITS_PER_LONG == 64
> > > __raw_writeq(*(u64 *)val, dest);
> > > #else
> > > spin_lock_irqsave(doorbell_lock, flags);
> > > __raw_writel((__force u32) val[0], dest);
> > > __raw_writel((__force u32) val[1], dest + 4);
> > > spin_unlock_irqrestore(doorbell_lock, flags);
> > > #endif
> >
> > And why is this code using the __raw_ versions? Seems wrong too...
> >
>
> for 64 and 32 as well?
yes
> what is wrong with the raw version ?
It should only be used by arch code (or in drivers linked to a
specific arch). The actual properties of the 'raw' version are arch
specific and make it hard to know if the driver will work on different
archs. ie some arches may not byte swap their raw accessors, or may
omit barriers.
Most likely this just wants to be writeq for 64 bit and
writel_relaxed() & writel() for 32 bit - unless there was some reason
to have used __raw versions in the first place (in which case a
comment is missing).
Jason
next prev parent reply other threads:[~2019-01-21 18:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-19 0:33 [PATCH mlx5-next 0/4] mlx5 next misc updates Saeed Mahameed
2019-01-19 0:33 ` [PATCH mlx5-next 1/4] net/mlx5: Make mlx5_cmd_exec_cb() a safe API Saeed Mahameed
2019-01-19 0:33 ` [PATCH mlx5-next 2/4] net/mlx5: Add pci AtomicOps request Saeed Mahameed
2019-01-19 0:33 ` [PATCH mlx5-next 3/4] net/mlx5: Remove unused MLX5_*_DOORBELL_LOCK macros Saeed Mahameed
2019-01-19 0:33 ` [PATCH mlx5-next 4/4] net/mlx5: Remove spinlock support from mlx5_write64 Saeed Mahameed
2019-01-19 7:43 ` Leon Romanovsky
2019-01-21 16:45 ` Jason Gunthorpe
2019-01-21 18:12 ` Saeed Mahameed
2019-01-21 18:22 ` Jason Gunthorpe [this message]
2019-01-25 18:16 ` Saeed Mahameed
2019-01-21 18:12 ` Saeed Mahameed
2019-01-24 12:30 ` [PATCH mlx5-next 0/4] mlx5 next misc updates Leon Romanovsky
2019-01-25 18:08 ` Saeed Mahameed
2019-01-27 7:51 ` Leon Romanovsky
2019-01-28 19:11 ` Saeed Mahameed
2019-01-29 7:58 ` Leon Romanovsky
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=20190121182200.GI25149@mellanox.com \
--to=jgg@mellanox.com \
--cc=eranbe@mellanox.com \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=maximmi@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@dev.mellanox.co.il \
--cc=saeedm@mellanox.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).