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=-7.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT 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 D2FCEC4360F for ; Wed, 3 Apr 2019 18:26:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 956AE20700 for ; Wed, 3 Apr 2019 18:26:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="FNury48j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726461AbfDCS05 (ORCPT ); Wed, 3 Apr 2019 14:26:57 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:36596 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbfDCS05 (ORCPT ); Wed, 3 Apr 2019 14:26:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MpjqHQ2HzGxCVqYxpjy1nZP4w4gLR2IqXxY1B2OAQh0=; b=FNury48jQ7X7qLl/AFXy5qJ4S owo8kh1SmkAmaYhT5SKFdEwpRym/t2rWq44jhlw7A71dCyIqKabu5jvK4IFU0Pa23SqZTGbgxnb38 VD6rK4DEkXhpgxtSbZbNmTTrEPT0rDpbTtgDJHQtnFgQ9EbZH57HnqYVh76K1jhlCakg6kX5+q4lL O8WkJ88dfsvQvwaTfrXImGwVh5/aYLuQKUwdo/4+tuygv/fyNhnjAGKru7fYFmnhfq8hFd4IZWJdg 4rdWBb4DPE7IWJ/0ii5kznUqSrlkcbC0jFv0/KxbHdamqDgMFsXkFh8hCk7HbhLukWI+JXqAgaITV iujYs89dA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51946) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hBkb3-0004ju-Df; Wed, 03 Apr 2019 19:26:49 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.89) (envelope-from ) id 1hBkau-00055z-HH; Wed, 03 Apr 2019 19:26:40 +0100 Date: Wed, 3 Apr 2019 19:26:40 +0100 From: Russell King - ARM Linux admin To: Christoph Hellwig Cc: x86@kernel.org, Sudip Mukherjee , Bartlomiej Zolnierkiewicz , linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: remove NULL struct device support in the DMA API Message-ID: <20190403182640.2ca6w2hngjqp35mt@shell.armlinux.org.uk> References: <20190321225235.30648-1-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190321225235.30648-1-hch@lst.de> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 21, 2019 at 03:52:28PM -0700, Christoph Hellwig wrote: > We still have a few drivers which pass a NULL struct device pointer > to DMA API functions, which generally is a bad idea as the API > implementations rely on the device not only for ops selection, but > also the dma mask and various other attributes, and many implementations > have been broken for NULL device support for a while. I think I must be missing something, but... My understanding is that ISA DMA is normally limited to 24 bits of address - indeed, the x86 version only programs 24 bits of DMA address. Looking through this series, it appears that the conversions mean that the DMA mask for ISA becomes the full all-ones DMA mask, which would of course lead to memory corruption if only 24 bits of the address end up being programmed into the hardware. Maybe you could say why you think this series is safe in regard to ISA DMA? > > This series removes the few remaning users that weren't picked up in > the last merge window and then removes core support for this "feature". > > A git tree is also available at: > > git://git.infradead.org/users/hch/misc.git dma-remove-NULL-dev-support > > Gitweb: > > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-remove-NULL-dev-support > -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux admin Date: Wed, 03 Apr 2019 18:26:40 +0000 Subject: Re: remove NULL struct device support in the DMA API Message-Id: <20190403182640.2ca6w2hngjqp35mt@shell.armlinux.org.uk> List-Id: References: <20190321225235.30648-1-hch@lst.de> In-Reply-To: <20190321225235.30648-1-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Christoph Hellwig Cc: x86@kernel.org, Sudip Mukherjee , Bartlomiej Zolnierkiewicz , linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org On Thu, Mar 21, 2019 at 03:52:28PM -0700, Christoph Hellwig wrote: > We still have a few drivers which pass a NULL struct device pointer > to DMA API functions, which generally is a bad idea as the API > implementations rely on the device not only for ops selection, but > also the dma mask and various other attributes, and many implementations > have been broken for NULL device support for a while. I think I must be missing something, but... My understanding is that ISA DMA is normally limited to 24 bits of address - indeed, the x86 version only programs 24 bits of DMA address. Looking through this series, it appears that the conversions mean that the DMA mask for ISA becomes the full all-ones DMA mask, which would of course lead to memory corruption if only 24 bits of the address end up being programmed into the hardware. Maybe you could say why you think this series is safe in regard to ISA DMA? > > This series removes the few remaning users that weren't picked up in > the last merge window and then removes core support for this "feature". > > A git tree is also available at: > > git://git.infradead.org/users/hch/misc.git dma-remove-NULL-dev-support > > Gitweb: > > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-remove-NULL-dev-support > -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up 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=-8.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT 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 A1D62C4360F for ; Wed, 3 Apr 2019 18:27:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 70E5220882 for ; Wed, 3 Apr 2019 18:27:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pLwe+Puz"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="FNury48j" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70E5220882 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AAfH4pAa+e3VTNM8A4a0+nHBFjfJm8HmPmxwSRY/eII=; b=pLwe+PuzbB4+kz 2settCWxtWDdDvHykcbZbszjbviIyYfpbHdh1tzMS3afQu6t2ZfJB7IQ0h4skmpeeT1VYzyk2VOtS 7IOi9dW6w3VetZNRvx+avVmNA4Y0fKJaWiYzLhNS08NmhVWH+TGOaNF+qRzb5WIOduLeplRj8adB5 Uc4PUsq9B/s8pigE3H0N1ik47STMDlYA3A6NlDWNa/X9RgPub5zRUnT2A3dvc56rspExUwtHx51xe BDi6MoZwEGZjMbfSovUf4wHOF/FmyB0/VmwtpE0LjQ8OaC8afhIYhN+XCr6DdYZ6w0vaiNo8NqI3e Q4FuZG0LYtJHARWD/Gqw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBkbT-0003KA-Jt; Wed, 03 Apr 2019 18:27:15 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBkbP-0003J7-NF for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2019 18:27:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MpjqHQ2HzGxCVqYxpjy1nZP4w4gLR2IqXxY1B2OAQh0=; b=FNury48jQ7X7qLl/AFXy5qJ4S owo8kh1SmkAmaYhT5SKFdEwpRym/t2rWq44jhlw7A71dCyIqKabu5jvK4IFU0Pa23SqZTGbgxnb38 VD6rK4DEkXhpgxtSbZbNmTTrEPT0rDpbTtgDJHQtnFgQ9EbZH57HnqYVh76K1jhlCakg6kX5+q4lL O8WkJ88dfsvQvwaTfrXImGwVh5/aYLuQKUwdo/4+tuygv/fyNhnjAGKru7fYFmnhfq8hFd4IZWJdg 4rdWBb4DPE7IWJ/0ii5kznUqSrlkcbC0jFv0/KxbHdamqDgMFsXkFh8hCk7HbhLukWI+JXqAgaITV iujYs89dA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51946) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hBkb3-0004ju-Df; Wed, 03 Apr 2019 19:26:49 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.89) (envelope-from ) id 1hBkau-00055z-HH; Wed, 03 Apr 2019 19:26:40 +0100 Date: Wed, 3 Apr 2019 19:26:40 +0100 From: Russell King - ARM Linux admin To: Christoph Hellwig Subject: Re: remove NULL struct device support in the DMA API Message-ID: <20190403182640.2ca6w2hngjqp35mt@shell.armlinux.org.uk> References: <20190321225235.30648-1-hch@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190321225235.30648-1-hch@lst.de> User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_112711_763391_6B55BF01 X-CRM114-Status: GOOD ( 13.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, iommu@lists.linux-foundation.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Bartlomiej Zolnierkiewicz , Sudip Mukherjee , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 21, 2019 at 03:52:28PM -0700, Christoph Hellwig wrote: > We still have a few drivers which pass a NULL struct device pointer > to DMA API functions, which generally is a bad idea as the API > implementations rely on the device not only for ops selection, but > also the dma mask and various other attributes, and many implementations > have been broken for NULL device support for a while. I think I must be missing something, but... My understanding is that ISA DMA is normally limited to 24 bits of address - indeed, the x86 version only programs 24 bits of DMA address. Looking through this series, it appears that the conversions mean that the DMA mask for ISA becomes the full all-ones DMA mask, which would of course lead to memory corruption if only 24 bits of the address end up being programmed into the hardware. Maybe you could say why you think this series is safe in regard to ISA DMA? > > This series removes the few remaning users that weren't picked up in > the last merge window and then removes core support for this "feature". > > A git tree is also available at: > > git://git.infradead.org/users/hch/misc.git dma-remove-NULL-dev-support > > Gitweb: > > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-remove-NULL-dev-support > -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel