Received: by 10.192.165.148 with SMTP id m20csp59912imm; Fri, 20 Apr 2018 03:02:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/o6gUPeTDHzBsYgSE9worc7eV5J59Xq5CNvBEx5ItCVVW7r+wYIOEuQKxR+XLs4/ECs46G X-Received: by 10.99.139.202 with SMTP id j193mr7675920pge.300.1524218534370; Fri, 20 Apr 2018 03:02:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524218534; cv=none; d=google.com; s=arc-20160816; b=kPEi2zEtf40+Kv248YUu5acFR/tIDviyXq916myeMYgxbCY8US/vbbGYxFjKJtC90B ZpSuBaISDf6sQvXcjlKluLWZRR1LdiOaOyo0wvTaT7Z+cY70yA/awtZqcXiXCrJdgEDa ISI06muTuIo3inGuNBsHZie1wJTs4kQfYVPynxQSd33D/eykOLLaztponaA+UHHV0t4k SRETV/+GEGEvBKPshLOT9017VpxKNSkP2BHovmuvC2HZR+0oYXoFcxj1K6gQ6tzH+Z6S YZgkoeIcCD3zOKsx6EAfqo1LCq4q4wgOorXg2Ae6ccMKdQkqRawXYf5PRMJWWNqnwx4l t8Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=YQabCzObeIFm67lzKACYoEfDxvMyPhb8YaYUDshW0gQ=; b=LWcKmJ6xIYrdjAVeXGkeeUu82XxWSKw3itxa43AMAsKiMhcuHEHZx3pIr4zmk/pT/k czc7fsj3CZKsx3GIca5ic+2fJ0v76fiRb2E8OxgZNhgrqvoTDEyzQoMj8C087FDoYAx3 INqtiUoqskhYx+cDftm0zA0cBBZpMBWK50sxa26ohI2gK4YMTwM9cGqrcG1K/ceRHObe 4UiYjZ8t/V0mPmJuqr7GHOIGPWRA4vqoVKOTwjbxHBfczWmwfy9k7We5DM/Vz5t7h9Zb oLAo30UmXOieHr8DIruUGj4aBeavrjqq5dZJ7n0r8QeCB7rDmqy+EaPHy8xvZ3R65poX nylA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Nbqzs/Dn; 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 d21-v6si5158511pll.460.2018.04.20.03.01.52; Fri, 20 Apr 2018 03:02:14 -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=fail header.i=@gmail.com header.s=20161025 header.b=Nbqzs/Dn; 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 S1754549AbeDTJ7R (ORCPT + 99 others); Fri, 20 Apr 2018 05:59:17 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:41295 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754513AbeDTJ7P (ORCPT ); Fri, 20 Apr 2018 05:59:15 -0400 Received: by mail-ua0-f195.google.com with SMTP id l3so3772557uak.8; Fri, 20 Apr 2018 02:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=YQabCzObeIFm67lzKACYoEfDxvMyPhb8YaYUDshW0gQ=; b=Nbqzs/DnX8nzqXIiE+9qj+6Z/rtick04FmO85AHXR8bW97yLZzlClGPhrXZ1JedHet 6zeCzk3mGkyF/JOld3ssI533gsW+bClFS5r2ggzKjN3tN1HbMT4kxMzdSDRI72n88Y2t 3pI9Iiv06aeC1W0gdDoFO4cy1mm3+h4aCI9Uk2YIysGsxfYrO2qoQjXCekRu3P5W91RX f4zEJmzP/Rxi6U5T3c9WzVyYOnhe6tIaXi2PPrYhGSzviwyOfFc3Voqa78Hp/cfCHgPF zNPsh/pztPn2bL1JIMxlQA3QrnZwG9SaMnHgjbRAqhl308N7KfGEr6VHPjF9tEqfInFX A6hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=YQabCzObeIFm67lzKACYoEfDxvMyPhb8YaYUDshW0gQ=; b=LZv0B5Yh5qMl9u8EtqT+I4TjhcD7GXmQyDgbsP1yi4u2SZLb8RBfqbJKgxVGmiACep zIF+qZo5E2MiHVaggGKsTFBZBUK1RFl17HyMBJbHah1rArRKDd7onjKk70InXgTezkw8 g53xW2bL8d1nWqDm4HbAxRAWpgHweOZ+B03Aso0x8yIpq9yCeLvyRWzwZXhucGuychTx hqNc6ZxvWbJd96qBCgOQkGNtXMC+KMqQkZd+YF/UjPHxnlMp+S7mSWP9IU57/vwnRhWF uXauATeRsoUn9MeKWauaMsklpBaHPAc+e/pMHR0Gk5+s6y0549p4CwRT2j0IN4pKfgXn 4NYA== X-Gm-Message-State: ALQs6tAHhk9vAq/ldAApODc5c0ghxyKxBYdBXBiVnfRnkIWf27C2j9l/ 39yLzt0gCLOg80B8+UAFQBnNcDYW0TGsSAuyzhGRgQ== X-Received: by 10.159.55.235 with SMTP id q98mr7100203uaq.4.1524218354340; Fri, 20 Apr 2018 02:59:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.122.68 with HTTP; Fri, 20 Apr 2018 02:59:13 -0700 (PDT) In-Reply-To: <20180420083147.GC31275@infradead.org> References: <1523972123-5700-1-git-send-email-jacopo+renesas@jmondi.org> <20180418104703.GA12462@infradead.org> <20180418131314.GC3999@w540> <20180420083147.GC31275@infradead.org> From: Geert Uytterhoeven Date: Fri, 20 Apr 2018 11:59:13 +0200 X-Google-Sender-Auth: 51nJHTbsL0rlzApckLAsSlsfgfM Message-ID: Subject: Re: [PATCH] sh: mm: Fix unprotected access to struct device To: Christoph Hellwig Cc: jacopo mondi , Jacopo Mondi , Yoshinori Sato , Rich Felker , Thomas Petazzoni , Robin Murphy , Linux-Renesas , Linux-sh list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoph, On Fri, Apr 20, 2018 at 10:31 AM, Christoph Hellwig wrote: > On Wed, Apr 18, 2018 at 03:13:14PM +0200, jacopo mondi wrote: >> As long as it goes for arch/sh, the only user of dma_alloc_coherent() >> is platform_resource_setup_memory(), and it has been fixed by this >> patch. > > Great! > >> Unfortunately, as Thomas pointed out, there are drivers which calls >> into this with the wrong 'struct device' as the sh_eth one he had fixed. > > Yes, we'll need fixes there. Other DMA ops implementations also look > at struct device, so they generally are buggy. > >> I would then say that as long as it goes for the NULL case, we should be >> fine now. > > Then I'd say skil that part, please. The major reason for keeping the NULL WARN_ON() checks is to make it obvious to the developer what is wrong, and fall back to the old behavior. Without the checks, the kernel will just crash during early startup, without a clue in the (missing) kernel output, usually leading to a frustrating bisection experience (if the developer is sufficiently motivated, at all). Hence my vote for keeping the checks. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds