Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3527707pxb; Mon, 16 Nov 2020 17:56:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4XQ6vrpNLaA+FtKU5e9cREmFGpa1Hg4zDRSPD3gmc1eOR1rq9ahb2WM411hUO0LP+Ub+p X-Received: by 2002:a17:906:c186:: with SMTP id g6mr16488827ejz.465.1605578164200; Mon, 16 Nov 2020 17:56:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605578164; cv=none; d=google.com; s=arc-20160816; b=IxpVO5zDSAVY9n1/CHnldFlIrRU9D57E4sW7cO6Q5anTzmzlRspqia6SxFuZpeqyy/ tww/4iQGbUfCC5EwtCU4dzgpOq3kYbQcLZZhQf+ersQIR0tLsRBzss9R+srzSEgJW8LH 84vM4vxEm6GXVbDrZnOPMml2goBb53nYIK1Y/v9Oz254/JWmsD0CTnGkHnIHnXXt4MOG z9MMA17UXwBN3b3qPQoBYhjbVI7cMy3LlJNro27KwGZeistyJQRILkAtejbsbRzfLX4Y 92K+RFee+YtwmxuKg31JB4Slumvpu2MhLZZD0gjYP5Luuj2ZThkyC+j6BfMkW8UQAu8Y IeIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=Qd/V7/auXUafl/mmu4wV/5UTH2jsCO9yUBd0yO33sBM=; b=wbN5tDv/lDAH2Aoje2Pc42g54HfwdJp/YACAtXYdEESipl3X7JcKDlCb3TkH+JSavX u+wcfcT6z0nqYCpvlPvdzM5iurfot5mwVpWs7Re3uYTBSCMDjG9kecOeJH/d1ZuHPbMk crIvk/M2rkBZrnslmBb3XjUBUGD63lp93a96Ki8rMKsJD5XaZFgXiiQef1nxWwhZYpb8 7PpRvt2Z90xEN+ZxHb+tPxUe+DlLHW+qF1rInUGFC/GfcBDj8en4bmmEgIkQnbvI8nXK 7fRbL55MuGK0gsRhQF4GsEm9wDG+Go9xvS7/Y+4V8pzewiqiCatj82IlVF8jXlT0I5V9 mRow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=VlQUg8MW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si12856281ejy.598.2020.11.16.17.55.41; Mon, 16 Nov 2020 17:56:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=VlQUg8MW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732279AbgKPQoC (ORCPT + 99 others); Mon, 16 Nov 2020 11:44:02 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:54420 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732245AbgKPQoA (ORCPT ); Mon, 16 Nov 2020 11:44:00 -0500 Date: Mon, 16 Nov 2020 16:43:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1605545037; bh=Qd/V7/auXUafl/mmu4wV/5UTH2jsCO9yUBd0yO33sBM=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=VlQUg8MWVCwoGEChmrB66g+17zZvHCemdWx/S3I3dZFwjlupgMZI3jfOCHeBcJ2fl dd4Fh90TmTDAWerIDzrDeHx+Jneyc124zM30lHxeixHJAN4MY35JfQTkX9FXZtm2tI Xgr+aNXYuNKTZ3q1u6PSPne2RTXMGVDtmZzDSN5PLhqFOqB1/xt3jsw0ApiRWTD7We QPMSv8e0GGQ0sApM1RHEblmUgPfOfftZ7RVvtm8y96lM7Pp9v9cbMQz6RVGIm3gu4+ 3YbIqss9xs/X0l06iiAL9uQKjrO9scMH86+shuElONyRLna8spU4YfHlJQdkdRMNBl Qkaz6MTQWfGcQ== To: Christoph Hellwig From: Alexander Lobakin Cc: Alexander Lobakin , Ohad Ben-Cohen , Mathieu Poirier , Arnd Bergmann , Amit Shah , Greg Kroah-Hartman , Arnaud Pouliquen , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Bjorn Andersson , linux-remoteproc@vger.kernel.org, Suman Anna , "Michael S. Tsirkin" , virtualization@lists.linux-foundation.org Reply-To: Alexander Lobakin Subject: Re: [PATCH virtio] virtio: virtio_console: fix DMA memory allocation for rproc serial Message-ID: In-Reply-To: <20201116162744.GA16619@infradead.org> References: <20201116091950.GA30524@infradead.org> <20201116045127-mutt-send-email-mst@kernel.org> <20201116162744.GA16619@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christoph Hellwig Date: Mon, 16 Nov 2020 16:27:44 +0000 > On Mon, Nov 16, 2020 at 04:51:49AM -0500, Michael S. Tsirkin wrote: >> On Mon, Nov 16, 2020 at 09:19:50AM +0000, Christoph Hellwig wrote: >>> I just noticed this showing up in Linus' tree and I'm not happy. >>> >>> This whole model of the DMA subdevices in remoteproc is simply broken. >>> >>> We really need to change the virtio code pass an expicit DMA device ( >>> similar to what e.g. the USB and RDMA code does), >> >> Could you point me at an example or two please? > > Take a look at the ib_dma_* helper in include/rdma/ib_verbs.h and > dma_device member in struct ib_device for the best example. Oh, best example indeed. I did really love these helpers and kinda wish there were such for Ethernet and wireless networking. They'd allow to keep the code more readable and clean and prevent from several sorts of silly mistakes. This could be done in e.g. 4 steps: - introduce such helpers for netdev/mac80211; - add checkpatch warnings to discourage usage of old methods like SET_NETDEV_DEV() and direct dereferencing of netdev->dev.parent; - slowly convert existing drivers to the new model; - remove the old way entirely along with checkpatch remnants. I could take this if there'll be enough votes :) Al