Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2522888rdb; Mon, 20 Nov 2023 13:19:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IG801LmRuyxCFgomvhIjYHTwVODq4KQP0U8Lf24pIeha8XQo0bLiynvgfdA/pANjVbj2+Q3 X-Received: by 2002:a05:6808:4d5:b0:3ab:74a2:ab2b with SMTP id a21-20020a05680804d500b003ab74a2ab2bmr10652346oie.48.1700515186577; Mon, 20 Nov 2023 13:19:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700515186; cv=none; d=google.com; s=arc-20160816; b=D3Y0El8F0u6fP7fEKFD/hL3arcX3PylDHqH0dmJun5Yky33MFbfX38bCHSfug6jEkW Mg5PeC/B1PlUxzJorQSUJb/lal3961ckIswOvnieaD6nOLeXpxxkyWrTC6shaEm44G3k I6z8qwnE1YfyKmkeNFXxt30e7SaaYkuwF9SIrkJ1gsgyXO2ddT6pAuZjre1oMFrAE8TP jYbXtE0qNg2oM4Wb6N2npk9WXaPLF6XMi1BnimABRCumP3ZcCafGRSp8upGYT0igWnIs cjxCajoLHWq50WyuXHvLyhTEhOpjTASM9F8HCqu5EjJJoPsOG7EYKRgOlD4rAxUblizI kXDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=NDPnmqlk0LUSy3aJ8u4TckgJQVNR/Wz4QBNCWhD8QiM=; fh=8rffCm7rfi6D3fim6Pm3CFukcC4N7JXvi4iuYARyGiw=; b=q7OgKa7z5RSs4T/bjX3IdtZluUylqc//cE4bCBtZ1Y0gcywBAf26wpbapfuu21SmFs 4ijFVM+u6dzlyvWZ6KvGaPc9VJZjxpZ4qOJD3imAPIptPKojTLN1457huGQcG+gjtaX5 CZr54ZJZQPhticULiU+QcALqopoK39CCJfr/pyO+dKh+EG3u50NcPmHgdQiOHp36zec9 HEUXwuHFJr5TxYM64IAeBVTclT0Pb+Rz+11NnKZgY8HE6rLVPucJSebbFSzxTQx24nMP DG+s8nJTR3icH9k01vRxKjOBgNwKrRkvUk+u4sF0zZXBqSRnWizhzI7dgPB6PuKKgn6w Mnwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=IkGePgdi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id t10-20020a6564ca000000b005c212dbc6besi7295827pgv.585.2023.11.20.13.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 13:19:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=IkGePgdi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D03388035ACD; Mon, 20 Nov 2023 13:19:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231724AbjKTVTh (ORCPT + 99 others); Mon, 20 Nov 2023 16:19:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230170AbjKTVTg (ORCPT ); Mon, 20 Nov 2023 16:19:36 -0500 Received: from smtp.smtpout.orange.fr (smtp-15.smtpout.orange.fr [80.12.242.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B42DD8 for ; Mon, 20 Nov 2023 13:19:31 -0800 (PST) Received: from [192.168.1.18] ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 5Bfyrw7Pe67J55BfyrmViA; Mon, 20 Nov 2023 22:19:29 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1700515169; bh=NDPnmqlk0LUSy3aJ8u4TckgJQVNR/Wz4QBNCWhD8QiM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=IkGePgdiytlmlYIsvLgHrV3QcmXS/XmZfe8oEEncW/6oLcIaWKQwAKWpzyQ9zQ/Eu hDz6csT6bF21q2VmW3PcqwIMOgfxTO98BhNsvUc+k0UeWmX986fXyyFx/+CMcXT2Rk hRM4EGJHHP4+36lKRVCU8okurLB9CgbBgVxto/m/Y5ewNNdTN5FBEqLYadIFPAWCK9 86NI8NpjOvX3HyZVWqnyt8dAJsntBlDOG6IO+eyKcxtxWdCtExSOt0Wl2n6Ozzpl9F PsgUKd9KGXe/oQVlSX+syna5KbUox0zWIgekrtfCWQcjoqus4t9DQ2bqr6Y3VKYjJg 8/fnGp8CVIoow== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 20 Nov 2023 22:19:29 +0100 X-ME-IP: 86.243.2.178 Message-ID: Date: Mon, 20 Nov 2023 22:19:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] serial: atmel: convert not to use dma_request_slave_channel() To: claudiu beznea , Jiri Slaby , Richard Genoud , Greg Kroah-Hartman , Nicolas Ferre , Alexandre Belloni Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <5c2ec2ff-459e-4bb7-b287-8a06005c86f5@kernel.org> Content-Language: fr, en-US From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 13:19:44 -0800 (PST) Le 20/11/2023 à 08:12, claudiu beznea a écrit : > > > On 20.11.2023 09:04, Jiri Slaby wrote: >> On 20. 11. 23, 7:14, claudiu beznea wrote: >>> Hi, Christophe, >>> >>> On 19.11.2023 17:55, Christophe JAILLET wrote: >>>> dma_request_slave_channel() is deprecated. dma_request_chan() should >>>> be used directly instead. >>>> >>>> Switch to the preferred function and update the error handling accordingly. >>>> >>>> Signed-off-by: Christophe JAILLET >>>> --- >>>> v2: Also update atmel_prepare_rx_dma() >>>> --- >>>>   drivers/tty/serial/atmel_serial.c | 16 ++++++++++++---- >>>>   1 file changed, 12 insertions(+), 4 deletions(-) >>>> >>>> diff --git a/drivers/tty/serial/atmel_serial.c >>>> b/drivers/tty/serial/atmel_serial.c >>>> index 1946fafc3f3e..6aeb4648843b 100644 >>>> --- a/drivers/tty/serial/atmel_serial.c >>>> +++ b/drivers/tty/serial/atmel_serial.c >>>> @@ -1013,14 +1013,18 @@ static int atmel_prepare_tx_dma(struct uart_port >>>> *port) >>>>       struct device *mfd_dev = port->dev->parent; >>>>       dma_cap_mask_t        mask; >>>>       struct dma_slave_config config; >>>> +    struct dma_chan *chan; >>> >>> There is no need for this. >> >> How'd you avoid crash in here then: >>         if (atmel_port->chan_tx) >>                 atmel_release_tx_dma(port); >> ? > > I wanted to say that instead of adding the chan variable the > atmel_port->chan_tx would be used instead. You mean something like: - atmel_port->chan_tx = dma_request_slave_channel(mfd_dev, "tx"); - if (atmel_port->chan_tx == NULL) + atmel_port->chan_tx = dma_request_chan(mfd_dev, "tx"); + if (IS_ERR(atmel_port->chan_tx)) { + atmel_port->chan_tx = NULL; ? Mostly a mater of taste. I can send a v3 with that if it is the preferred style. CJ > >> >> thanks, >