Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp588728lqb; Wed, 17 Apr 2024 05:46:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLGuXpDh86gBRUEWMXFMdQi68eHem2t6Zkxb7ykNMZKIXGXohV3ENswZ4zhCTeT2Ojs8DkL5aFzhHqAJgYN1G7tgiLR9xAaL+LXBX0vA== X-Google-Smtp-Source: AGHT+IGZWnVlhGan5kuK/52ybCrXpWdQixxuh5/yf/6SoxxH3sc8ykZ/uzkS/q4H/gu+dNxeXxtt X-Received: by 2002:a05:6214:564f:b0:69b:16bb:d66a with SMTP id mh15-20020a056214564f00b0069b16bbd66amr15897591qvb.47.1713357971363; Wed, 17 Apr 2024 05:46:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713357971; cv=pass; d=google.com; s=arc-20160816; b=ESDRXEM/J4VIv+/lRyXOEFIB2lAw7nxeXsr3b3ezGYoU3xZgsZ64CwduUGDbFblOc8 pAeCd+0vJWMk6sKtoLYHPP5ADyNWoRT/7mC5noShXpX/QktNvdxXnDXShdPRaVhq6lwh oGDYAuFzzk2DGo8nFSA+nlEYZs4pT+6oD7+mwkXufW2sWcaYEtCWFurmW16yJJQ5sKyq C2CosDuieuEZ+VmYJAvURwy6zX17DQ/b/xOVSsTv43taqSgAiI1DsKCsDYGMQOAakaDG b2ex6RACoc4Wc/wFsAlcAwFmoGWIEfmRm6oA99o3JTt2Dwc/F5lJJsLPHOWaByOkOFuj V4iA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:cms-type:content-transfer-encoding:in-reply-to:from :content-language:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature:dkim-filter; bh=jMsyPeaSfZB3Bp5BiMNyNkxY5JdlO/Ls0SekL1wNeFw=; fh=9kb7XvmYHViIRK1l/9SKeNovLfHwTB3ZKeL9uz6et1E=; b=lEzDM/NcClBoEXxLXr8FEe/R/b9E+EjdA7uWXCxXi88wBRZmYA/E8u28scCLfFOGkR nlZeNu71AMSNGBBvLBVe5z2RhpKZC/S2sr1Y5F6FzCoNwwUST/6EnhKTU7hz20hyDmRB WrioZrho1RKpHoXwV+SBlosI8ftjVejwecTu6I8nO4skzg0tN2RjkA/4Qu0wJvzOyIpF DAuo/FDNqjydPEv3bAuwqaKYBjvd40oCsRj06px1SigmI0Os7owxSGsxgczpGK5fJ+c7 CL4dXIVp7pMSu8i+vRIyQHcj9vht6LI8NZz4ueOBo0wKTWutFLZ15CXnxLZJbmiAW3TC 5l9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=V4duwP1a; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-148488-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148488-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f17-20020a056214165100b0069c8457cb6dsi4960974qvw.387.2024.04.17.05.46.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 05:46:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148488-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=V4duwP1a; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-148488-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148488-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 979E61C216DA for ; Wed, 17 Apr 2024 12:46:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08F5013D265; Wed, 17 Apr 2024 12:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="V4duwP1a" Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2EF112C80B for ; Wed, 17 Apr 2024 12:45:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713357963; cv=none; b=nxVqi4oIqwLlG8zbTh1WZbmQogngHMkVkyHbDUZmsrI7xWVR5GHm2+WxlPHv4qhowxe71b4XwW8GtnZzlyD4pr3N7Kt4c/zIMl4fwUeaRYkjiAd1CQ3OHXT8TnFInmo2Lb+lGkBTYwQURPQe4nTZGZ5xC6neks700KncDYrnqp0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713357963; c=relaxed/simple; bh=BpDfj6K6uOzWGFxwYpcorDN3dmeqwSPWjsSyiakgnNs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To: Content-Type:References; b=DRJSpHxRLISgj6+AdcLKfr1/sOVoVcZtLylUAPBlmaxKWIXJgtKTWpES0Ei4ETBjhFEqxHnXQ5txp00o6Kd+iu9AYhPp+gcSrTLsobtKgN32XM2QWTTCAA+7qYnrpkSPvjryAa/Udjr+gmCjdSCaa5jggdQJPn2XwrSl2sQ/Dpo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=V4duwP1a; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240417124557euoutp0234ab9683769c83986d59f21f0f8a5011~HEfwfhNJk1802118021euoutp02p for ; Wed, 17 Apr 2024 12:45:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240417124557euoutp0234ab9683769c83986d59f21f0f8a5011~HEfwfhNJk1802118021euoutp02p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1713357957; bh=jMsyPeaSfZB3Bp5BiMNyNkxY5JdlO/Ls0SekL1wNeFw=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=V4duwP1aQ4eIN+MQvsGAy2kgyB5SKs9tiKIUCM1+SdQM1ssQCVcyLlR8Z5BfLnCPq ZRcrhcLDUs6u8idT3n4v5ghyGEv8CCC4P3oA9V5rGe02drgBenuSzG/LGpV0MDQe4W 6vmJIviP5M5uqFYkRfbUSJAV0j2PKSE5WKuqc6H4= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240417124557eucas1p1ed8ea22922afdca179d62737fd85fa23~HEfwSoywx1924719247eucas1p1Z; Wed, 17 Apr 2024 12:45:57 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id BE.F6.09875.584CF166; Wed, 17 Apr 2024 13:45:57 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240417124557eucas1p2ba44b1c8081ba8c5926375606f837920~HEfv44kPf2304723047eucas1p2Z; Wed, 17 Apr 2024 12:45:57 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240417124557eusmtrp1c3ab13585dc407bfb19978d43a8ac5ca~HEfv4SNlt2359923599eusmtrp1N; Wed, 17 Apr 2024 12:45:57 +0000 (GMT) X-AuditID: cbfec7f4-11bff70000002693-13-661fc48585ba Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A1.AD.09010.484CF166; Wed, 17 Apr 2024 13:45:57 +0100 (BST) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240417124556eusmtip16aa5e430bee4b8dbea9d2ad9e8547d8d~HEfva4Gkw1821218212eusmtip1q; Wed, 17 Apr 2024 12:45:56 +0000 (GMT) Message-ID: Date: Wed, 17 Apr 2024 14:45:56 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 11/15] tty: msm_serial: use dmaengine_prep_slave_sg() To: Jiri Slaby , gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, Anders Roxell Content-Language: en-US From: Marek Szyprowski In-Reply-To: <783c05cd-0cd2-4b0e-9dce-2a9fdfee7c74@kernel.org> Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDKsWRmVeSWpSXmKPExsWy7djPc7qtR+TTDH6clLW4NeU3k8W2DhuL 5sXr2SzezZWx6Ji8ncVi4v6z7BaXd81hszizuJfdgcNj06pONo871/aweeyfu4bd4/MmuQCW KC6blNSczLLUIn27BK6MHdf3sxU0ilRc3XiYqYFxmUAXIyeHhICJxOVVT5m6GLk4hARWMEqc nPuNEcL5wihx88cuVgjnM6PEwwWHmWFa3v9cB5VYziixZOo1qP6PjBITv29kAaniFbCTeHb5 FJDNwcEioCqx51AgRFhQ4uTMJ2AlogLyEvdvzWAHsYUFPCWettxmBikXEXCUaP1bDTKSWeAu o8SM3VvZQGqYBcQlbj2ZzwRiswkYSnS97QKLcwKt+rpgOTtEjbxE89bZzCDNEgJ3OCRuzrnA DnG1i8S+u59ZIWxhiVfHt0DFZSROT+5hgWhoZ5RY8Ps+E4QzgVGi4fktRogqa4k7536xgZzH LKApsX6XPkTYUWLOjlusIGEJAT6JG28FIY7gk5i0bTozRJhXoqNNCKJaTWLW8XVwaw9euMQ8 gVFpFlKwzELy5iwk78xC2LuAkWUVo3hqaXFuemqxUV5quV5xYm5xaV66XnJ+7iZGYAI6/e/4 lx2My1991DvEyMTBeIhRgoNZSYS3RVg2TYg3JbGyKrUoP76oNCe1+BCjNAeLkjivaop8qpBA emJJanZqakFqEUyWiYNTqoGpYgnDczGR9MqO1/uc2ryuXp7yp2E5a2PbqkUixuHSi4/d/SL5 r2uKXY71we9li2y/5S+u//0+94D24bMWi97I2L6ezZbY/WD/3pPC6555H2XRddZZIHCt0s8h 69Qslde+yyxPb9M8+t353tvw6MK59+X4+3mldl2rOBnD8uEwD//+/+vunOQyu/Jkyvcpi65l z3kQ7/zhz+6GqTPWtBtpTFk/2e2ufAFHyNxy5ea1Ez5MyTu3I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Xsnet/h6 7fklc9dLMp8RyHtkaMF72ObW/bBp+eZ6aelCDj/YkiYeczk/I2DZsu1nV9W6V6f1r95u//dx r8uJxi7TkEAzE2l5PyWW4oxEQy3mouJEAMY9OdNAAwAA X-CMS-MailID: 20240417124557eucas1p2ba44b1c8081ba8c5926375606f837920 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20240415211716eucas1p10050cc8d4024707dd6f6331111cd3ce1 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240415211716eucas1p10050cc8d4024707dd6f6331111cd3ce1 References: <20240405060826.2521-1-jirislaby@kernel.org> <20240405060826.2521-12-jirislaby@kernel.org> <54679d54-3957-489d-a8b5-b98ea1c8a93c@kernel.org> <0335b679-da36-42c1-a1ba-8affb7a98d44@samsung.com> <783c05cd-0cd2-4b0e-9dce-2a9fdfee7c74@kernel.org> On 17.04.2024 12:50, Jiri Slaby wrote: > On 17. 04. 24, 12:15, Marek Szyprowski wrote: >> On 16.04.2024 12:23, Jiri Slaby wrote: >>> On 15. 04. 24, 23:17, Marek Szyprowski wrote: >>>> On 05.04.2024 08:08, Jiri Slaby (SUSE) wrote: >>>>> This is a preparatory for the serial-to-kfifo switch. kfifo >>>>> understands >>>>> only scatter-gatter approach, so switch to that. >>>>> >>>>> No functional change intended, it's just >>>>> dmaengine_prep_slave_single() >>>>> inline expanded. >>>>> >>>>> And in this case, switch from dma_map_single() to dma_map_sg() too. >>>>> This >>>>> needs struct msm_dma changes. I split the rx and tx parts into an >>>>> union. >>>>> TX is now struct scatterlist, RX remains the old good phys-virt-count >>>>> triple. >>>>> >>>>> Signed-off-by: Jiri Slaby (SUSE) >>>>> Cc: Bjorn Andersson >>>>> Cc: Konrad Dybcio >>>>> Cc: linux-arm-msm@vger.kernel.org >>>> >>>> I've just found that this patch broke UART operation on DragonBoard >>>> 410c. I briefly checked and didn't notice anything obviously wrong >>>> here, >>>> but the board stops transmitting any data from its serial port >>>> after the >>>> first message. I will try to analyze this issue a bit more tomorrow. >>> >>> I double checked, but I see no immediate issues in the patch too. So >>> please, if you can analyze this more… >> >> I've spent some time digging into this issue and frankly speaking I >> still have no idea WHY it doesn't work (or I seriously mixed something >> in the scatterlist principles). However I found a workaround to make it >> working. Maybe it will help a bit guessing what happens there. > ... >> @@ -434,7 +436,7 @@ static void msm_start_tx(struct uart_port *port) >>           struct msm_dma *dma = &msm_port->tx_dma; >> >>           /* Already started in DMA mode */ >> -       if (sg_dma_len(&dma->tx_sg)) >> +       if (dma->mapped) > > Thanks for looking into this. > > I was hesitant if I should use a flag. I should have, apparently. > > Quick question: > What's value of CONFIG_NEED_SG_DMA_LENGTH in your .config? CONFIG_NEED_SG_DMA_LENGTH=y I alse tried to change the "if (dma->mapped)" check in msm_start_tx() to: 1. if (dma->tx_sg.length) 2. if (dma->tx_sg.page_link & ~SG_PAGE_LINK_MASK) but none of the above worked what is really strange and incomprehensible for me. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland