From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D35FAC7619B for ; Mon, 17 Feb 2020 00:36:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A39972067D for ; Mon, 17 Feb 2020 00:36:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="jtpOapbH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726650AbgBQAgO (ORCPT ); Sun, 16 Feb 2020 19:36:14 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:33725 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726560AbgBQAgN (ORCPT ); Sun, 16 Feb 2020 19:36:13 -0500 Received: by mail-qk1-f196.google.com with SMTP id h4so14725083qkm.0 for ; Sun, 16 Feb 2020 16:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=PAiDoNcDSsPnNj5W4mWsQjtsAOyOXebI5Rn/LeRO4A0=; b=jtpOapbHFVjp/wJYElpr+0+UN+bnlIm8e5HSRL2u+Y9QkgTx8DY8UMOMNuycHEMJca Y4FkUIHdZPwmPx1cJYizjiP458SAypboQ6RKWnROZb8xEEagkFUFAmmJ4gDJzZ5qmwf1 dM039k0juLOOeE1Bg699rDYhNyGIoPHBHYIGZgiQ9RVTXp6TFbiirga3jYjVWEN0FuUf HzrS/XUtO3uRp67ScZMRUVlbcNDCoUIag9WreZ+KXOIaQ7gO/vb1dMcLVf8EOc6mq67D DnnGURL6m+33HicB+cg1TApImTExGruhDQE3mqo3kwVwc0Q/pgFUZW1adIWKhpNeRX4U fWMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=PAiDoNcDSsPnNj5W4mWsQjtsAOyOXebI5Rn/LeRO4A0=; b=lfYqAEDoUZ++m3S6ouWp0pDND231MHi/yBQv9iCxjXmOY2UjaYmZCGxD6WDRro0IG0 CmfGDyV/MDhjmrtpRabB1yFtwCDZR02pctB7PMlLDn1cv+DjU6LnNFlXFPb/kAdGM6WI 5BYvMP60EZ2jJjF2vnGWXI/PVmKwlpkvrgC7zFMV5dPcyS5M47MIKrREoLFa38pdTwIO 92J0ZjqUZZCVSmtBFvaXUg86sI/qrmsfBlnxulPe210o2g7S72+vKLGjt1wEO8bXWE5/ Oor8rq79scW95DJgEsG3+OIs+QQpoVMA2K00wUJtZZH7m7XJRJNgvS1aniP33Jtkxzzu t/kQ== X-Gm-Message-State: APjAAAUNuIeWAGMNc1P8xl64e9WYZMfxgjdNDCu6LVXRSiungkGYcwz+ FNml/htwTjSBLy8KL03KwnA6qA== X-Google-Smtp-Source: APXvYqxeQ1g+jpqlNityj8TgopMrjNmz4CclX96hSYDzY9HRLgVtbwu71aVJTN32smWAWDoy73fOQw== X-Received: by 2002:a37:6690:: with SMTP id a138mr9654539qkc.475.1581899772343; Sun, 16 Feb 2020 16:36:12 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id h13sm7852610qtu.23.2020.02.16.16.36.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Feb 2020 16:36:11 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1j3UOQ-0003Nj-Fg; Sun, 16 Feb 2020 20:36:10 -0400 Date: Sun, 16 Feb 2020 20:36:10 -0400 From: Jason Gunthorpe To: Maxim Mikityanskiy Cc: Alexander Lobakin , Leon Romanovsky , Doug Ledford , Yishai Hadas , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH rdma] IB/mlx5: Fix linkage failure on 32-bit arches Message-ID: <20200217003610.GC31668@ziepe.ca> References: <20200214191309.155654-1-alobakin@dlink.ru> <20200214192410.GW31668@ziepe.ca> <6f7c270fef9ec5bae2dcb780dee3f49f@dlink.ru> <3c70c7da-60aa-10ec-767f-5e519357b8e6@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3c70c7da-60aa-10ec-767f-5e519357b8e6@mellanox.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 16, 2020 at 01:53:50PM +0200, Maxim Mikityanskiy wrote: > On 2020-02-14 21:44, Alexander Lobakin wrote: > > Jason Gunthorpe wrote 14.02.2020 22:24: > > > On Fri, Feb 14, 2020 at 10:13:09PM +0300, Alexander Lobakin wrote: > > > > Commit f164be8c0366 ("IB/mlx5: Extend caps stage to handle VAR > > > > capabilities") introduced a straight "/" division of the u64 > > > > variable "bar_size", which emits an __udivdi3() libgcc call on > > > > 32-bit arches and certain GCC versions: > > > > > > > > error: "__udivdi3" [drivers/infiniband/hw/mlx5/mlx5_ib.ko] > > > > undefined! [1] > > > > > > > > Replace it with the corresponding div_u64() call. > > > > Compile-tested on ARCH=mips 32r2el_defconfig BOARDS=ocelot. > > > > > > > > [1] https://lore.kernel.org/linux-mips/CAMuHMdXM9S1VkFMZ8eDAyZR6EE4WkJY215Lcn2qdOaPeadF+EQ@mail.gmail.com/ > > > > > > > > > > > > Fixes: f164be8c0366 ("IB/mlx5: Extend caps stage to handle VAR > > > > capabilities") > > > > Signed-off-by: Alexander Lobakin > > > >  drivers/infiniband/hw/mlx5/main.c | 3 ++- > > > >  1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > Randy beat you too it.. > > > > > > https://lore.kernel.org/linux-rdma/20200206143201.GF25297@ziepe.ca/ > > > > Ah, OK. Sorry for missing this one. I didn't see any fix over > > git.kernel.org and thought it doesn't exist yet. > > > > > But it seems patchwork missed this somehow. > > > > > > Applied now at least > > Jason, I think Alexander's patch is more correct. It uses div_u64, while > yours uses div64_u64. The divider is 32-bit, so div_u64 would be more > optimized on most 32-bit architectures. Seems so, but it is already done. You can send a followup to fix it Jason