Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1439338pxv; Fri, 16 Jul 2021 09:20:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/7aceStUyBkqvxWLR3w75p1ZunVNJUnp39VdFeQ6ICSeHq/MJoWqK4V1xD6CKk/i9mXMP X-Received: by 2002:a5d:8986:: with SMTP id m6mr7910154iol.87.1626452419189; Fri, 16 Jul 2021 09:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626452419; cv=none; d=google.com; s=arc-20160816; b=kb8xbm9hVbJxWJxtb8TxfztT96HhbNJf3DIShmxihxAMUuNu3YZC+iBRNZrHDm4Gth zMI/J1XXnY87Nse1lpE/r4MVSrq7F91ScvROqIM9xz339izhFVgMtFokueSEjmzmTQzd 01rJ+HIh+oMDGJf2wDDTsiZJ4cQpckC651ZL+1E2ar5ua5YUnNR7v3fkKXR41A49fmWN gFmPWj3zbNFLCT7QRifJqrz+8tjZ996GyJbSxCNYNbRWrJv+N0W0LwYp17GX29tnDWdW ld+xKL2rMuiaDrtxZxBToZ1i+MlqfA0Mj7MOhlmEhhApL0BCSUURczFEyTPc82AteKC9 gtYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:dkim-signature; bh=BnhY0izzSFVDQcuht2cro6XvHSIBnnpJHK/4w8E4yWs=; b=fdFpFQ2c7CeCe1LBljeETj8YQdkARPpSY4ZP18S1O3jqR3YMZg6aQZSuhet+TDJ/ax L3KWGBNcJejvaDIM2XXJeE9ZMr2fFh3bJxkiDP6hIO1xDf3sKXCbihp/EmH1Yj7ju9bJ WZsmupo+arBAPb4xENcabs423+3JjVR3D/IihmtmZyTFgejfh/OPXrAqKBt91qmetZj3 pFou4CC0EbjZ69KW+hjuhzxEXJBzOTMR3EHUyhxn0XHgLSMQJKM9o0KAMutFQN7sJXlo 2f2ctlvJNgAsfL9qY77dK2p57ncBuvestaceA2WSsHGRyNyTnQANTEj8DdoViDAXDOiV fxVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=lHiHBr9U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r18si10572784ile.92.2021.07.16.09.20.05; Fri, 16 Jul 2021 09:20:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=lHiHBr9U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229840AbhGPQVI (ORCPT + 99 others); Fri, 16 Jul 2021 12:21:08 -0400 Received: from ale.deltatee.com ([204.191.154.188]:57206 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbhGPQVF (ORCPT ); Fri, 16 Jul 2021 12:21:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:content-disposition; bh=BnhY0izzSFVDQcuht2cro6XvHSIBnnpJHK/4w8E4yWs=; b=lHiHBr9UmxsphzyuJXXrFvFkXJ nHnU2Aad+t4uXkXpqnoYYQXL8s0VDrTpcUrSa7MBf3lHNc8SwA72FIyA0EFnNsLaMjuY1HyVFc4eY 86UCMlrgVGkMX16Elm46rVT3dMTeEwZNCX1a+CjIpwSiCKZgO96vmX56LfZWgzS5j7bcdiascYBT7 QpZUtkyACvD3Bob5Y0jFlifJMDasY0nH1O+2FuN7wP4IsecNoMeLFw+7g7lmwXVQFM8ujekY7qsib a39261ZQjmb8njie60hE0kfk/jWrRkVOwj7hryYFQZ5ncmwJY+tyhtISQB4927wPhvb2n8G328kwr zFWziVNw==; Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.92) (envelope-from ) id 1m4QXJ-0003ky-3C; Fri, 16 Jul 2021 10:18:01 -0600 To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, iommu@lists.linux-foundation.org, linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org, Marek Szyprowski , Robin Murphy , Stephen Bates , Martin Oliveira References: <20210715164544.6827-1-logang@deltatee.com> <20210715164544.6827-17-logang@deltatee.com> <20210716063332.GD13345@lst.de> From: Logan Gunthorpe Message-ID: <82c0f8d8-9050-dcf7-d68d-93691878a6dd@deltatee.com> Date: Fri, 16 Jul 2021 10:17:58 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210716063332.GD13345@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: martin.oliveira@eideticom.com, sbates@raithlin.com, robin.murphy@arm.com, m.szyprowski@samsung.com, xen-devel@lists.xenproject.org, linux-parisc@vger.kernel.org, iommu@lists.linux-foundation.org, sparclinux@vger.kernel.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, linux-ia64@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, hch@lst.de X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH v1 16/16] dma-mapping: Disallow .map_sg operations from returning zero on error X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-07-16 12:33 a.m., Christoph Hellwig wrote: > On Thu, Jul 15, 2021 at 10:45:44AM -0600, Logan Gunthorpe wrote: >> @@ -194,6 +194,8 @@ static int __dma_map_sg_attrs(struct device *dev, struct scatterlist *sg, >> else >> ents = ops->map_sg(dev, sg, nents, dir, attrs); >> >> + WARN_ON_ONCE(ents == 0); > > Turns this into a negative error code while we're at it, just to keep > the callers sane? > Sure thing. All the feedback makes sense, we'll fix it up and send a v2 in due course. Thanks, Logan