Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp859604pxu; Wed, 6 Jan 2021 06:25:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBp/Ytjrc8gLpJXylueNrY1soH0humQtksi1cllsbE2a25EbJT46gW8Vm9PTdCBN6U2nDe X-Received: by 2002:aa7:c547:: with SMTP id s7mr4116708edr.240.1609943134366; Wed, 06 Jan 2021 06:25:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609943134; cv=none; d=google.com; s=arc-20160816; b=syj80O8TnkD7vArUxKWKbDMC2rcyMODhAHIkoClNEY/3mMzxjN6otHoJOdjM80JMz+ Qb8AItcaP4QbUaY/GI0nAt+tEnjyFBQQcf+FsVzeHFhiHY8wBgu4YSdDjMI/bi8SAecH vhQLPX8UIBXEFMlb2T3XvSPk8FHQ9MA+uubFCVOe/leZIsacGIVuirxwcpdSd3dfe6T5 7a1LA4fRYwLYxUoDl5zhFfZ+9AOMMnTkroK3EGLXu8eOAB/p6vxhdeY72vTjgR0rIyH/ g0XXvTVe5NNfzYxmU6hSEPwIllIC/JfhEmhNNYnzdZEVheZVfNSalolvxueUwrQ6d8CB 7w/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GhYUHio+7nPG9DGI5AkPnAgJBj7Ar2wEKgM/dyhqYss=; b=UcB4xBI1Rg6ClYSGgdpO53s8WirW1g+7+APg3XL+yBJgC22L6H9np3zFCYTtbENVRn /D5om0gJJw+69sqrtuLCX5HGJ02/ExHkw1NbG4kCi1Eu+dLiOIXfDV2FziJsZR/pzyKa 9Z9unh0e+CdhPPZIH9RgSou+KVH/f709WHQXUloFzcEXpPPxlHeMRLeWSATQV/nqehiq gn7cspiMkmvroYE0t+WbD930Ahmq0m0IvC/jqq93Z/LNa5ssqGVufmpWcmUPI31ej2cJ uCn4p79zwNM4A16wQbrv4/zwNRlh8Y959umtVIr6OsGWvN7rhw1z+vMrLWb8XikeLj92 huyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hH6ty5vh; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y26si997649edo.273.2021.01.06.06.25.10; Wed, 06 Jan 2021 06:25:34 -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=@linuxfoundation.org header.s=korg header.b=hH6ty5vh; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727208AbhAFOWz (ORCPT + 99 others); Wed, 6 Jan 2021 09:22:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:57754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727205AbhAFOWy (ORCPT ); Wed, 6 Jan 2021 09:22:54 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D806C22DD3; Wed, 6 Jan 2021 14:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609942934; bh=Cb1pMkbG+D1lMDSZbLfzNbe9TFmhAojQGLpCxZfsZfM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hH6ty5vh9rDgEOugJ3Vf4jWy4Xn1kpzqi8VKbT7TAyxTi1chPQaq5gRTAnz12Ouly 7q+RgJJNa1u/b9fE6JJx+XHQeacgabdMvDRUd/HzWqun5aq9CeYTv+6behFSse6XDJ 39EiAC8qjMKGhFjq4eRDaOuYueo4pxq1PtLbbySg= Date: Wed, 6 Jan 2021 15:23:33 +0100 From: Greg KH To: Eli Billauer Cc: arnd@arndb.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH] char: xillybus: Add driver for XillyUSB (Xillybus variant for USB) Message-ID: References: <20201213170503.59017-1-eli.billauer@gmail.com> <5FF5C31C.6050804@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5FF5C31C.6050804@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 06, 2021 at 04:03:08PM +0200, Eli Billauer wrote: > Hello Greg, > > Merging XillyUSB's driver into xillybus_core.c was of course the initial > idea. Practically, it turned out that this doesn't reduce the number of code > lines nor makes the code easier to understand: The XillyUSB driver is a > completely different deal internally, in almost every aspect of it. > > Indeed, the two drivers do basically the same thing: They create a pipe-like > API using a hardware interface that is based upon buffers. This is what most > of the code in both drivers is about. As this underlying hardware interface > is so fundamentally different, there is little in common between the > drivers. > > The existing xillybus_core.c driver is based upon direct memory register + > DMA interaction with the hardware. XillyUSB relies on the USB framework for > all communication. I'll try to demonstrate the practical differences with > two examples. > > (1) Sending commands to the hardware: The existing Xillybus driver just > writes to registers in memory space. Its XillyUSB counterpart calls > xillyusb_send_opcode() to prepare a little packet for transmission over USB, > and may possibly sleep if there's a (temporary) lack of resources to > complete that task. > > (2) Data handling: The existing Xillybus driver just copies user data to and > from DMA buffers. Its main business is to maintain and juggle these buffers > with the hardware. The XillyUSB driver, on the other hand, manages a pool of > URBs to efficiently shuffle the data to and from the hardware. The main > challenge is to keep the data flowing at 400 MB/s. > > This goes on for every single aspect of the two drivers: They do the same > things essentially, but the actual actions are completely different, as they > have different means to do get the job done. And completely different > challenges. That's fine, but I'm talking about the userspace api. You should not be creating two different userspace apis just because the bus transport changed for the hardware. We don't do that for things like tty devices, right? :) So please, share the same core code that exports the api to userspace to be common, do not create a new one, like you did here. thanks, greg k-h