Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1346557imm; Fri, 11 May 2018 15:02:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqnm6e87B2gm2trAVZeQmA9UHyrzzNlDaCiewjgkvIW2TIRVvITCQh3tCjo5oZi7JdphUea X-Received: by 2002:a17:902:322:: with SMTP id 31-v6mr7138589pld.122.1526076159158; Fri, 11 May 2018 15:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526076159; cv=none; d=google.com; s=arc-20160816; b=OynP/0+8SPm6TyDxNGDWWSUVx1+19Dmko0JIIoD/UDhMZxLgOADm5gYAVWiGAkLjP+ qxljPbOwsZ2K5X+rwUegsQNqkshXIGwp3y1fshpG/+xn2iUP3U78Bayk6dv1uEwDlbI4 4b+d+gkf/jTwuuoc0mGX/knWoaqzKEkssjJmILhAjrj/nlCQTQnraR6h9nGmSE4RUtAC I0iPHH/NK/DAwUD+oUNkcp91JUh0p7fHn7s4ZoIauhJUJf8/7AaynkIRJIqVNykme5PO 2PdJeN2YI0ZSByljJdhzEUuS94zeKjo/2xQ7OpIBsIaVLgsUYu/qYXY/U2gQ6QIa5M9o FuiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=KrAxbKfSJuvUPEhFZ1lvFqPy66Gw7TisHNLrtvw9cDw=; b=PeGiYeOZ7MQInA9Q4zrfxBUBvtDX+jp/l3xeFk4HBtRMy+SDkR0UNbYFR02cuP2a5S 6HfLj5usePnnC6vfAOMXe0Ufoqz9tNk1z/zCG0JtIw3t0+B2C7YNocOTCFVX133qLczX rPjO85GJaMnJCIBwn1iQUAFkLZ6cuUqYacrmiloeOelCIMupxBlAGT0R/9A1AUfJl0qz 88dDNmnVBT6jZeRmOmC18YLTeP+9GZCBlqZakX6IF6pfRIYt4Mb0I7+FqNIbyHE6inA8 vbKS4sBAcP4k2Y59lS0bXYNuXkpfYz77aFE3ALp3sZ3dUcZ5mw2k3FTgT0S+pKFQ61Vh Z7JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CSX6IE8x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8-v6si4192654pfh.278.2018.05.11.15.02.23; Fri, 11 May 2018 15:02:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CSX6IE8x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751596AbeEKWCO (ORCPT + 99 others); Fri, 11 May 2018 18:02:14 -0400 Received: from mail-pl0-f41.google.com ([209.85.160.41]:38485 "EHLO mail-pl0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750989AbeEKWCM (ORCPT ); Fri, 11 May 2018 18:02:12 -0400 Received: by mail-pl0-f41.google.com with SMTP id c11-v6so3995222plr.5; Fri, 11 May 2018 15:02:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=KrAxbKfSJuvUPEhFZ1lvFqPy66Gw7TisHNLrtvw9cDw=; b=CSX6IE8xjwWmY45i2hm6ykY/5Auoj000XyDto8noc7lvlrueeghVWm2GwV+cb4HHQo Kw5kPq7a/fUYAtT3X1HS2OmNadc6aR3rZ02OZDEtYIPBzYyRXzmwlHj58OyJvC2lVzJh Ec26/i1gahwOcyxfNUFYebR9gFhzeCqDm0gnMJ2E73dFH2Anq0fmFMZGHg2spE0jdanw jqJUet8635qzwjgIZ1PdSvly/tZyA1AF6StCgOr6t+307TD6LHPC3vHTZxMAKe6GUz6q ARdvuIJCXRnFCPyFf6B/y1YwBr/DiCjt0EL4KPQzaFtJq1G03odxW0hJMTq/HRcjQPC9 oenQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=KrAxbKfSJuvUPEhFZ1lvFqPy66Gw7TisHNLrtvw9cDw=; b=DeAs9tAbw1L4+YbDWw5AXvIPS+O51fi2pEeHr3QUyLnB1YU9QFJK0UT77E+wP8iL7K h5EdWEBI1qwRTQKmE37/jgxKCxp3R4iy+l18Mf9iJ9qbBTRb8J9nMVgf9FvwPc+LqV9V 89fUUXcafI1PLcFV7tQp1sqUjy55m+cysorh4sXLKUGkLNFOlkPKEAjkvqyAlGnLPBBz mnPCvg/+DqokVgNhmSiQ1qj2mO1XRGSuPb30+5y91R92qrUzM9EPMsgINshl2GW947ao cG/03Klc8EVMLfBgq8/uWyCGXperN23rCc6mXpBrEPUBBEaQiRXPRX4IdSPsLTP22z31 rk0A== X-Gm-Message-State: ALKqPwdlmfZa68Mj7qBkvQjbFqy3Bsj/jmZ/TNZJyk7bWCPwt3+/+p/L x3QMvBF++aTVSs8tWXMlYYstYg== X-Received: by 2002:a17:902:ac1:: with SMTP id 59-v6mr7229905plp.367.1526076131545; Fri, 11 May 2018 15:02:11 -0700 (PDT) Received: from [192.168.1.101] (222-154-41-72-adsl.bb.spark.co.nz. [222.154.41.72]) by smtp.gmail.com with ESMTPSA id m22-v6sm9999637pfg.20.2018.05.11.15.02.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 15:02:10 -0700 (PDT) Subject: Re: [PATCH net] macmace: Set platform device coherent_dma_mask To: Finn Thain References: <0b13a08d-ba2d-b9dc-4fd9-1f6bad5cd1ee@gmail.com> <8c2c3ad5-eeb5-cf61-b9fb-c6096619e310@gmail.com> Cc: Geert Uytterhoeven , "David S. Miller" , linux-m68k , netdev , Linux Kernel Mailing List , Christoph Hellwig From: Michael Schmitz X-Enigmail-Draft-Status: N1110 Message-ID: <23ed7ff8-c1d7-a069-3058-3944c7586116@gmail.com> Date: Sat, 12 May 2018 10:02:03 +1200 User-Agent: Mozilla/5.0 (X11; Linux ppc; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Finn, Am 11.05.2018 um 22:06 schrieb Finn Thain: >> You would have to be careful not to overwrite a pdev->dev.dma_mask and >> pdev->dev.dma_coherent_mask that might have been set in a platform >> device passed via platform_device_register here. Coldfire is the only >> m68k platform currently using that, but there might be others in future. >> > > That Coldfire patch could be reverted if this is a better solution. True, but there might be other uses for deviating from a platform default (I'm thinking of Atari SCSI and floppy drivers here). But we could chose the correct mask to set in arch_setup_pdev_archdata() instead, as it's a platform property not a driver property in that case. >> ... But I don't think there are smaller DMA masks used by m68k drivers >> that use the platform device mechanism at present. I've only looked at >> arch/m68k though. > > So we're back at the same problem that Geert's suggestion also raised: how > to identify potentially affected platform devices and drivers? > > Maybe we can take a leaf out of Christoph's book, and leave a noisy > WARNING splat in the log. > > void arch_setup_pdev_archdata(struct platform_device *pdev) > { > WARN_ON_ONCE(pdev->dev.coherent_dma_mask != DMA_MASK_NONE || > pdev->dev.dma_mask != NULL); I'd suggest using WARN_ON() so we catch all uses on a particular platform. I initially thought it necessary to warn on unset mask here, but I see that would throw up a lot of redundant false positives. Cheers, Michael