Received: by 10.213.65.68 with SMTP id h4csp2159471imn; Thu, 5 Apr 2018 09:58:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx48HGWkGrKecr/Is2lsooBtSzqJKdhgQFEty0ikVzqn+l/VxiBqLYq4eRsmI4yLJipi86Q0p X-Received: by 10.99.100.132 with SMTP id y126mr15088863pgb.77.1522947485047; Thu, 05 Apr 2018 09:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522947485; cv=none; d=google.com; s=arc-20160816; b=RSSwEtTPLUxs/j6Pucv2OHBVk8l3NRTbLuQpfvAtEEnUh9aVR8HfRSX6hE6RQpXz+0 1+TitgiNLubCB9veN7kVAsdgtaqnXzJZ3kV70U4mb4PvTbebc63matT8/iwHGRxjMXjI MmiYSYgw7J9vEpAYVid08edNJk5Vv5JX0umaNtzZ9exPzb723xovmmHCGYZ0JZE6tKq2 jR9WhAz8WDrIdWDR72w+Pfv7o/4+FVcdAvtNKvtH4toidYSTKHcfWUXTg1jiZxX8hYvs fnYAeMfIdL7RESip+N3daUDYkrKN9juE5wjfix9XLX6K2rWW9fQTxhgSI1LMywQzOXkf UFYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=77UbDCa23ng2yHtv+2ajmAyBk24pTStyWoGKOq9xm3w=; b=JbzWTlfBuwhlYN6x7fvm7Iy270aNl3976GOs8wlpO8AVFRqSYwpaGiR0+jDHEl1DeV pNOd0KUf7+AfmP0JDa37l4dwfq8nbEA7ZaZkVCCBW+DpuqUg9xhP/WYD3fFOin5qj98+ SnjAmpK+3RkoCIZFHFWT/MUY2ErBBpLdGWHR74ZxQNCNbb0eNIirZ7ws2Y24f7aeciQy f99Jp/Czzp3nJhuAVFIF7I9nKo9U4uHCU77PA5SSulk2ep4VZaYEZGbrJQoHavVKZ04g N9L17RXW0/I4GY+U6peSxA0likkBMSFXNUx6Ja0Ld3yBAaV8epaPmuIqBzYdLuu1xQ8h bBkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=DOTA4kWs; 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 k33-v6si5988120pld.158.2018.04.05.09.57.48; Thu, 05 Apr 2018 09:58:05 -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=@lunn.ch header.s=20171124 header.b=DOTA4kWs; 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 S1751401AbeDEQ4h (ORCPT + 99 others); Thu, 5 Apr 2018 12:56:37 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:51872 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726AbeDEQ4f (ORCPT ); Thu, 5 Apr 2018 12:56:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=77UbDCa23ng2yHtv+2ajmAyBk24pTStyWoGKOq9xm3w=; b=DOTA4kWsStWm4zmkAIiksmQBbi1/L2b2nQV1kkNwSXKhEMLqS2Vcaiq3VRKa2TMm3LM6XVkPxMKS+5ZW6CkIVqOZtiSozZrmMCNTTaaHKOdNcj/sqXtYDcoX/TeMNLosDnr+tbPMdWdKClH/cUmOYD3xUPXy/FcRw1C427xnvXI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1f48Bb-0004ts-GS; Thu, 05 Apr 2018 18:56:31 +0200 Date: Thu, 5 Apr 2018 18:56:31 +0200 From: Andrew Lunn To: gregkh Cc: Ruxandra Ioana Ciocoi Radulescu , Laurentiu Tudor , Stuart Yoder , Arnd Bergmann , Ioana Ciornei , Linux Kernel Mailing List , Razvan Stefanescu , Roy Pledge , Networking Subject: Re: [PATCH v3 2/4] bus: fsl-mc: add restool userspace support Message-ID: <20180405165631.GB17495@lunn.ch> References: <20180404124246.GA20869@lunn.ch> <5AC5FAA8.80409@nxp.com> <20180405114736.GA12178@lunn.ch> <5AC61393.7090509@nxp.com> <20180405124810.GE12178@lunn.ch> <5AC63610.4000504@nxp.com> <20180405152348.GC32663@lunn.ch> <20180405161214.GB9976@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180405161214.GB9976@kroah.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Hi Andrew, > > > > We're waiting for the DPIO driver (which we depend on) to be moved > > out of staging first, it's currently under review: > > https://lkml.org/lkml/2018/3/27/1086 > > That's stalled on my side right now as the merge window is open and I > can't do any new stuff until after 4.17-rc1 is out. So everyone please > be patient a bit... I took a quick look. There are a few inline functions in .c files which is generally frowned upon. Let the compiler decide. e.g: static inline struct dpaa2_io *service_select_by_cpu(struct dpaa2_io *d, int cpu) static inline struct dpaa2_io *service_select(struct dpaa2_io *d) dpaa2_io_down() seems to be too simple. dpaa2_io_create() sets up interrupt triggers, notifications, and adds the new object to the dpio_list. dpaa2_io_down() seems to just free the memory. Do notifications need to be disabled, the object taken off the list? dpaa2_io_store_create() allocates memory using kzalloc() and then uses dma_map_single(,,DMA_FROM_DEVICE). The documentation says: DMA_FROM_DEVICE synchronisation must be done before the driver accesses data that may be changed by the device. This memory should be treated as read-only by the driver. If the driver needs to write to it at any point, it should be DMA_BIDIRECTIONAL (see below). Since it has just been allocated, this seems questionable. I'm also not sure where the correct call to dma_map_single(,,DMA_FROM_DEVICE) is? Should dpaa2_io_store_next() doing this? The DMA API usage might need a closer review. Andrew