From: James Hogan <jhogan@kernel.org>
To: "Keller, Jacob E" <jacob.e.keller@intel.com>
Cc: "Michael, Alice" <alice.michael@intel.com>,
Guenter Roeck <linux@roeck-us.net>,
Ralf Baechle <ralf@linux-mips.org>,
"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
Shannon Nelson <shannon.nelson@oracle.com>
Subject: Re: [RFC PATCH] MIPS: Provide cmpxchg64 for 32-bit builds
Date: Mon, 12 Mar 2018 23:12:11 +0000 [thread overview]
Message-ID: <20180312231211.GF21642@saruman> (raw)
In-Reply-To: <02874ECE860811409154E81DA85FBB5882CDAA1C@ORSMSX115.amr.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 4286 bytes --]
On Wed, Feb 14, 2018 at 09:36:33PM +0000, Keller, Jacob E wrote:
> > -----Original Message-----
> > From: Michael, Alice
> > Sent: Wednesday, February 14, 2018 1:03 PM
> > To: Guenter Roeck <linux@roeck-us.net>; James Hogan <jhogan@kernel.org>;
> > Keller, Jacob E <jacob.e.keller@intel.com>
> > Cc: Ralf Baechle <ralf@linux-mips.org>; linux-mips@linux-mips.org; linux-
> > kernel@vger.kernel.org; Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; Shannon
> > Nelson <shannon.nelson@oracle.com>
> > Subject: RE: [RFC PATCH] MIPS: Provide cmpxchg64 for 32-bit builds
> >
> > As has previously been said, we're going to be removing the need for cmpxchg64.
> > But it takes a little bit of time and work to do so. I'm adding the dev that is taking
> > care of the work back onto this email thread as well so he can see any concerns with
> > it.
> >
> > Alice
> >
> > -----Original Message-----
> > From: Guenter Roeck [mailto:groeck7@gmail.com] On Behalf Of Guenter Roeck
> > Sent: Monday, February 12, 2018 3:57 PM
> > To: James Hogan <jhogan@kernel.org>
> > Cc: Ralf Baechle <ralf@linux-mips.org>; linux-mips@linux-mips.org; linux-
> > kernel@vger.kernel.org; Michael, Alice <alice.michael@intel.com>; Kirsher, Jeffrey T
> > <jeffrey.t.kirsher@intel.com>; Shannon Nelson <shannon.nelson@oracle.com>
> > Subject: Re: [RFC PATCH] MIPS: Provide cmpxchg64 for 32-bit builds
> >
> > On Mon, Feb 12, 2018 at 11:42:02PM +0000, James Hogan wrote:
> > > Hi Guenter,
> > >
> > > On Mon, Feb 12, 2018 at 02:37:01PM -0800, Guenter Roeck wrote:
> > > > Since commit 60f481b970386 ("i40e: change flags to use 64 bits"),
> > > > the i40e driver uses cmpxchg64(). This causes mips:allmodconfig
> > > > builds to fail with
> > > >
> > > > drivers/net/ethernet/intel/i40e/i40e_ethtool.c:
> > > > In function 'i40e_set_priv_flags':
> > > > drivers/net/ethernet/intel/i40e/i40e_ethtool.c:4443:2: error:
> > > > implicit declaration of function 'cmpxchg64'
> > > >
> > > > Implement a poor-mans-version of cmpxchg64() to fix the problem for
> > > > 32-bit mips builds. The code is derived from sparc32, but only uses
> > > > a single spinlock.
> > >
> > > Will this be implemened for all 32-bit architectures which are
> > > currently missing cmpxchg64()?
> > >
> > No idea.
> >
> > > If so, any particular reason not to do it in generic code?
> > >
> > Again, no idea. When the problem was previously seen on sparc32, it was
> > implemented there.
> >
> > > If not then I think that driver should be fixed to either depend on
> > > some appropriate Kconfig symbol or to not use this API since it
> > > clearly isn't portable at the moment.
> > >
> > Good point.
> >
> > > See also Shannon's comment about that specific driver:
> > > https://lkml.kernel.org/r/e7c934d7-e5f4-ee1b-0647-c31a98d9e944@oracle.
> > > com
> > >
> >
> > Well, this was an RFC only. Feel free to ignore it.
> >
> > FWIW, this is the second time that the call was introduced in the i40 driver.
> > After the first time the code was rewritten to avoid the problem, but now it came
> > back. Someone must really like it ;-). For my part, I may just blacklist the offending
> > driver in my builds; that is less than perfect, but much easier than having to deal with
> > the same problem over and over again. Guess I'll wait for a while and do just that if
> > the problem isn't fixed in a later RC.
> >
> > Guenter
>
> Hi,
>
> I've been working on re-writing some of the code so that the need for a compare-and-exchange in the i40e_set_priv_flags() is not necessary. This mostly involved moving many flags out into an atomic bitops field instead, it should be posted to IWL soon.
Any update on this? Will a fix to the driver make it into 4.16 or is it
going to be too big a change?
As far as I can tell from grepping around, of the architectures which
support 32-bit SMP with PCI, these ones implement cmpxchg64 on 32-bit:
arch/arm
arch/ia64
arch/x86
arch/riscv (blindly implements using 64-bit instructions, broken?)
arch/parisc (with spinlock)
arch/sparc (with spinlock)
And these don't:
arch/arc
arch/mips
arch/powerpc
arch/sh
arch/xtensa
(I've excluded arches which are already being removed)
Cheers
James
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-03-12 23:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-12 22:37 [RFC PATCH] MIPS: Provide cmpxchg64 for 32-bit builds Guenter Roeck
2018-02-12 23:42 ` James Hogan
2018-02-12 23:56 ` Guenter Roeck
2018-02-14 21:02 ` Michael, Alice
2018-02-14 21:36 ` Keller, Jacob E
2018-03-12 23:12 ` James Hogan [this message]
2018-03-12 23:17 ` Keller, Jacob E
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=20180312231211.GF21642@saruman \
--to=jhogan@kernel.org \
--cc=alice.michael@intel.com \
--cc=jacob.e.keller@intel.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux@roeck-us.net \
--cc=ralf@linux-mips.org \
--cc=shannon.nelson@oracle.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 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.