Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754548AbbKMBzv (ORCPT ); Thu, 12 Nov 2015 20:55:51 -0500 Received: from mail-ig0-f182.google.com ([209.85.213.182]:33164 "EHLO mail-ig0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754386AbbKMBzs (ORCPT ); Thu, 12 Nov 2015 20:55:48 -0500 Subject: Re: [PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag for struct serial_rs485 To: Andy Shevchenko References: <1447338836-8785-1-git-send-email-matwey@sai.msu.ru> <1447338836-8785-3-git-send-email-matwey@sai.msu.ru> <20151112195707.5e9cb1d8@lxorguk.ukuu.org.uk> <5644F4F2.2080408@hurleysoftware.com> <564538B4.20402@hurleysoftware.com> Cc: One Thousand Gnomes , "Matwey V. Kornilov" , Greg Kroah-Hartman , jslaby@suse.com, "linux-kernel@vger.kernel.org" , "linux-serial@vger.kernel.org" From: Peter Hurley Message-ID: <56454322.9050803@hurleysoftware.com> Date: Thu, 12 Nov 2015 20:55:46 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1996 Lines: 43 On 11/12/2015 08:26 PM, Andy Shevchenko wrote: > On Fri, Nov 13, 2015 at 3:11 AM, Peter Hurley wrote: >> On 11/12/2015 07:41 PM, Andy Shevchenko wrote: >>> On Thu, Nov 12, 2015 at 10:22 PM, Peter Hurley wrote: >>>> On 11/12/2015 02:57 PM, One Thousand Gnomes wrote: >>> >>>> An illustrative (kernel-space) example is the mess that is dmaengine_pause(). >>>> Some DMA implementations provide the means to stop and restart DMA without >>>> losing data and some DMA implementations do not. Unfortunately, some >>>> advertise they support dmaengine_pause() but only for lossy uses like audio. >>>> Because the api hides this, the query interface for pause support is >>>> useless. >>> >>> The DMA pause() call means only pause with possibility to resume. >>> There is a resume() call as well. Any driver which treats pause() as a >>> complete stop is buggy driver and should be fixed. >> >> How about pause _without_ the possibility to resume? >> >> https://groups.google.com/d/msg/linux.kernel/Abe0hfGcgsw/H0se55wC558J > > Briefly what I got from the thread that Russell shows similar view on > the API, so that's why he was objecting to add pause/resume calls for > a specific hardware. Not quite. That dmaengine driver (omap-dma) advertises that it supports pause() via dma_get_slave_caps(). And if you call it with a cyclic channel it will pause. However, if you call dmaengine_pause() with a slave channel it returns an error *because the hardware can't actually meet the criteria for dmaengine_pause()* which is pause()/resume() without data loss. IOW, there is no method of determining a priori if dmaengine_pause() will categorically fail for a given transfer type. Regards, Peter Hurley -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/