Received: by 10.192.165.148 with SMTP id m20csp1577679imm; Thu, 3 May 2018 01:39:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqxm8fBHeph4SNeW3gEa05BC1WFeoML2UxNLA6/S+MybX8CoRBblminO0/p4Az3319aRwNb X-Received: by 2002:a63:3688:: with SMTP id d130-v6mr18585881pga.228.1525336767463; Thu, 03 May 2018 01:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525336767; cv=none; d=google.com; s=arc-20160816; b=UYSwMHaSpkXb15SDoQm6IWeo6zDJoTgYa1jGZDtnWeRVZ83ODLd9WfGgWOM04l2Ebn n+pfpw26lLIt4R92EzwvRLAL7TTvF96fl8TdzviugxcD9QS14YYNQdsYvRBJoy2/VXJf 2EAuEFE1d674+xlHpOk/VYgqQsUchF3MSOJ3vd2bzT3WMLc87D21+7HW17OvyMsXwk2c JoZExVNJW0WMotklkFl3nFHkRo0jVqhl+kh3kSLUgKv9nHyMqe+rWOJ9A/758V3Vbm7f rmI5LgnN8UMq7cQobkPtOjDY1XbnjimviI0DeeuuYzIFltXwojfEPmiDyZ0h+5mt4I4U cwqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date:arc-authentication-results; bh=/PE8LqAtIA8JCUNcZQ9ue92AydXuzfzQmx1yQjwGb/0=; b=mio8kjP8F2ZEmLdYyTDsKnvT1pogdByFcSG+h1i+x7xDwGxecUZRPq7iYM5vxcsFqm kWJd576KyNbluv0QjzH+Qij9ht9rle6T9WnPss7+La9FnQLNz+O64PgF4svLBVme4gFc OtASz5KwGFQtd0xWix3d7ewn3zOIk+kR0kdL31ld6SN6nc6K+48TgMk/CWwgN9qlCa0Y cugzlQ8sxbjKiKGC4oKuaM081SXFWcD4ppxItxNpIfSpEkfIHc7RN7bwJ81sNPwpQ4ek FgdsrfEwB2HPhz938w4MngyXVU6NrO23xzAsKTx3vu/ZqhtJio4GzvhyB4qMd5Y4vozK Udcg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s83si13660548pfg.175.2018.05.03.01.39.13; Thu, 03 May 2018 01:39:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbeECIii (ORCPT + 99 others); Thu, 3 May 2018 04:38:38 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:56614 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751196AbeECIif (ORCPT ); Thu, 3 May 2018 04:38:35 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id B656C22BAA; Thu, 3 May 2018 04:38:22 -0400 (EDT) Date: Thu, 3 May 2018 18:38:21 +1000 (AEST) From: Finn Thain To: Geert Uytterhoeven cc: "David S. Miller" , linux-m68k@lists.linux-m68k.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] macmace: Set platform device coherent_dma_mask In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 3 May 2018, Geert Uytterhoeven wrote: > > --- a/drivers/net/ethernet/apple/macmace.c > > +++ b/drivers/net/ethernet/apple/macmace.c > > @@ -203,6 +203,10 @@ static int mace_probe(struct platform_device *pdev) > > unsigned char checksum = 0; > > int err; > > > > + err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); > > + if (err) > > + return err; > > + > > dev = alloc_etherdev(PRIV_BYTES); > > if (!dev) > > return -ENOMEM; > > Shouldn't this be handled in the platform code that instantiates the > device, i.e. in arch/m68k/mac/config.c:mac_platform_init()? > I wondered about that too. The downside is that I'd have to convert platform_device_register_simple() into platform_device_register() and add all of the boilerplate that goes with that, for little gain. > Cfr. commit f61e64310b75733d ("m68k: set dma and coherent masks for > platform FEC ethernets"). > Yes, I looked at that patch before I sent this one. It makes sense to set the mask when defining the device since some devices tend to have inherent limitations (but that's not really applicable here). Moreover, it turns out that a number of platform drivers already call dma_set_mask_and_coherent() or dma_coerce_mask_and_coherent() or similar. I figured that platform drivers aren't expected to be particularly portable. Well, I'd expect macmace and macsonic to be portable to NuBus PowerMacs, but AFAIK the correct mask would remain DMA_BIT_MASK(32). So that's how I ended up with this patch. But if you are not pursuaded by my reasoning then just say the word and I'll take another approach. -- > Gr{oetje,eeting}s, > > Geert >