From patchwork Tue Nov 8 12:19:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 17012 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2668931wru; Tue, 8 Nov 2022 04:21:30 -0800 (PST) X-Google-Smtp-Source: AMsMyM7l+vVz7Po1orQdJqRi03jKtr7arnq4XEbnaPy7fARlBVUqLLQs7dR02JHpixmE8VLhDJq1 X-Received: by 2002:a50:ec99:0:b0:462:2c1c:8764 with SMTP id e25-20020a50ec99000000b004622c1c8764mr54589361edr.325.1667910090318; Tue, 08 Nov 2022 04:21:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667910090; cv=none; d=google.com; s=arc-20160816; b=RH7UU7FHEX+vW1upA01xmXn95WknMD/8mH24VvCgmXz/UU+5IDNgOqjR8RhR6vGRu2 7Eq9+ZoYrzQW9xYhhDRV4n3rTWvyP/+glmNANKjU7YByI0ps+1U9SEBMxyMcTatn0+Nq buJWJJbZr+vb0kN7eeMypKQ6pwOGI1X11WHRBuik92b38b82kJrtYg8GO8RFRmOiwXyo CeT0HV6mxkNjoZgQWF6/FCKWQNabKu0NkhFdsLDWvOXEfk3D5HfXFWaaOaL3qAbuH/uv FQqpZWjSAIPQ4k5Nlp9wozB1jDjs8tPHujKemmolE8wmpz2LjNOA5QJfggNtH1oO6Oz/ UlCw== 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:date:subject:cc:to:from :dkim-signature; bh=SF5Pxn4OGlPPN4YLxF2fdydUKEE9fzugmM5ct9n1V8Q=; b=0ijKHr5k9xKqcYAEtkFSAK+HRIJugPvuF2EvxdnHIOIT5/e7svmwsBDc5Xv2YX69xY Y1uiTYaiKEBvZf8Vv4jvvSpBkTQrGX/oM3tLTNxhzKwf60IyrSJGnFmSj0gIgiFc6wbV TA+leOi7xPIggsqXxsESyG+aqxZZUW5QS8h0E+YC8l6AHTcm+Cqzkz1fRB9TpWfCLtCx nJMcKPDTx9RALMn2zw4opHDmwlVCuee/SCL7B7quT/9FnVMnm0pMyi8p96TlrO6EfXr2 3eUEUAg8ulMwUnnp4cGaJAIkFRWhj2SOYsramNpuCseMmgBwZj77Xoora5XibJAP13sN ZjuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=H+fztD5n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v16-20020a056402349000b0045ca15afe1csi14899445edc.553.2022.11.08.04.21.03; Tue, 08 Nov 2022 04:21:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=H+fztD5n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234170AbiKHMUZ (ORCPT + 99 others); Tue, 8 Nov 2022 07:20:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234153AbiKHMUS (ORCPT ); Tue, 8 Nov 2022 07:20:18 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C14413EBE; Tue, 8 Nov 2022 04:20:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667910015; x=1699446015; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JLWjR1QhfIzzz63zvvQ1hW3NXrVYq+1ORm+qFn4evPQ=; b=H+fztD5nJTicnbF1On56Tq8LoLYsdaCJGuhmoaVE3IFKNPOKl96xp6PH rqll8cGfJGG5xHGm6PQOCxEFo2e3+x2uVnQHR6rlMHcAHfuyyIdy/hVfd ESFNYyowpIjbxNDPqbpVu6l0nrKmxq8acMZBbvt9+XnKrwVn+DEo8pD+k CBOHujmuxVPGgqM6X7IGQOVYAEY/F6ydyNt83SawBh9M3CJlZF6gG4J+3 cJ73Rm48QTUBTOAPgC5l6i5iOTyPqyHMXan7H8SUeE+kFXuZt1iZGMoSr 15rs1LOeYIc+0HMD8MApSH3R7klwQIzmlvnVt9KzJo66wqalsQrw1qbht Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="311834679" X-IronPort-AV: E=Sophos;i="5.96,147,1665471600"; d="scan'208";a="311834679" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 04:20:15 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="741932198" X-IronPort-AV: E=Sophos;i="5.96,147,1665471600"; d="scan'208";a="741932198" Received: from ppkrause-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.249.44.73]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 04:20:12 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Andy Shevchenko , =?utf-8?q?Ilpo_J=C3=A4?= =?utf-8?q?rvinen?= , linux-kernel@vger.kernel.org Cc: Gilles BULOZ , stable Subject: [PATCH v2 2/4] serial: 8250_lpss: Configure DMA also w/o DMA filter Date: Tue, 8 Nov 2022 14:19:50 +0200 Message-Id: <20221108121952.5497-3-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108121952.5497-1-ilpo.jarvinen@linux.intel.com> References: <20221108121952.5497-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748930490873514312?= X-GMAIL-MSGID: =?utf-8?q?1748930490873514312?= If the platform doesn't use DMA device filter (as is the case with Elkhart Lake), whole lpss8250_dma_setup() setup is skipped. This results in skipping also *_maxburst setup which is undesirable. Refactor lpss8250_dma_setup() to configure DMA even if filter is not setup. Cc: stable Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/8250/8250_lpss.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c index 44cc755b1a29..7d9cddbfef40 100644 --- a/drivers/tty/serial/8250/8250_lpss.c +++ b/drivers/tty/serial/8250/8250_lpss.c @@ -277,8 +277,13 @@ static int lpss8250_dma_setup(struct lpss8250 *lpss, struct uart_8250_port *port struct dw_dma_slave *rx_param, *tx_param; struct device *dev = port->port.dev; - if (!lpss->dma_param.dma_dev) + if (!lpss->dma_param.dma_dev) { + dma = port->dma; + if (dma) + goto out_configuration_only; + return 0; + } rx_param = devm_kzalloc(dev, sizeof(*rx_param), GFP_KERNEL); if (!rx_param) @@ -289,16 +294,18 @@ static int lpss8250_dma_setup(struct lpss8250 *lpss, struct uart_8250_port *port return -ENOMEM; *rx_param = lpss->dma_param; - dma->rxconf.src_maxburst = lpss->dma_maxburst; - *tx_param = lpss->dma_param; - dma->txconf.dst_maxburst = lpss->dma_maxburst; dma->fn = lpss8250_dma_filter; dma->rx_param = rx_param; dma->tx_param = tx_param; port->dma = dma; + +out_configuration_only: + dma->rxconf.src_maxburst = lpss->dma_maxburst; + dma->txconf.dst_maxburst = lpss->dma_maxburst; + return 0; }