Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3828713pxu; Mon, 12 Oct 2020 02:10:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfdAclkXX5+FYo48IDnPXiYAhyqjbwu7zA7N4sLu75IufkfEMWg6D7trMTGvz6HMidmmig X-Received: by 2002:a17:906:3290:: with SMTP id 16mr25209926ejw.308.1602493831829; Mon, 12 Oct 2020 02:10:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602493831; cv=none; d=google.com; s=arc-20160816; b=vNS1bh9OHjXOueIf6PhJVDw1OfII/aOoVwPPCVM8cGTJOwuWvzeErF3drZw1u9yhfG 7v0TqErHkWPCOBHV9I0Go9XIMRz+Hjs9ZMuYoea2oRerfj/UZXhlWR3PykBasslP1gkr Vv4LzCD2/9X5J+3npfMVSR5qYuubO1tAEGvaFM844fi3LEa8vllXbijgVtrd8jobmX6/ fZ7Sy6XGGdNOByFMAz6dvsyVHQ8MMeOhmvrnCY0KBiHk/Vv4TlTIGz/OENA32zO4yMbj iP4Mq/0Apmrac0dLpNt5YXYMSTZkfaLN30FBthe5H3FJ76LLNyZdIvLKQE9dX0aVjDTz onnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=HXcfH8bow9YsdJB21VFaGzkbIhBQ3UPg17GtDKnIiwg=; b=V96K8p2aVj2LqRWtNzZ3tS6R1/1u1TIO1xMql6UYXRK2VZUfWV/A9NqdklLXXTxhzl megc3PuRzu6LkLIg0XfLiGKUGBxAJqcWwGFA1gChiX38oU9YzFpRDe1VbmmMHQRb6wca GZLIeyovEtoAdEFMxNasDcfNzX4BUFxjmSWmqCm8w7xIBN5l/fl3/IkeIWGM/pSklSgS JAheZ4/4TivuJEQ0TOQNZ5N/K8yKBBoFZaHOkBL/FHT7OITf1VPdC2pQ7mwcS5gRQ4sl 5fMNoodbMvvoJQBDZkFZiFtzF83uAsAaciXb3Jhx/604vc7X6egHEM3WQDGwEkmsP9WJ 2C9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=okpD8C7D; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd24si10422865ejb.523.2020.10.12.02.10.08; Mon, 12 Oct 2020 02:10:31 -0700 (PDT) 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=@mg.codeaurora.org header.s=smtp header.b=okpD8C7D; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729164AbgJLJIC (ORCPT + 99 others); Mon, 12 Oct 2020 05:08:02 -0400 Received: from m42-4.mailgun.net ([69.72.42.4]:48638 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729150AbgJLJIC (ORCPT ); Mon, 12 Oct 2020 05:08:02 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1602493681; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=HXcfH8bow9YsdJB21VFaGzkbIhBQ3UPg17GtDKnIiwg=; b=okpD8C7Dvs96aGqsL7bwmsbgqtaQDeguCXrbVd4uW1LWWP26AoL9leqL5ptmts7/5hbOvpL3 hthJIqDhz3Li7lAuMgwZpThtuZg5Plj0Twt5o9EVimHtMz6IOKQr4PVrJKYinPDyZhS5Tdsn mY9ryCATnRypwpjkgVg+1PVTDWw= X-Mailgun-Sending-Ip: 69.72.42.4 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-east-1.postgun.com with SMTP id 5f841c5cd63768e57b36dde4 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 12 Oct 2020 09:05:32 GMT Sender: akashast=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 61857C433CB; Mon, 12 Oct 2020 09:05:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.43.98] (unknown [47.9.68.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akashast) by smtp.codeaurora.org (Postfix) with ESMTPSA id AF35AC433C9; Mon, 12 Oct 2020 09:05:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AF35AC433C9 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=akashast@codeaurora.org Subject: Re: [PATCH 1/3] soc: qcom: geni: More properly switch to DMA mode To: Stephen Boyd , Bjorn Andersson , Douglas Anderson , Wolfram Sang Cc: linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org, Andy Gross , Girish Mahadevan , Karthikeyan Ramasubramanian , Mukesh Kumar Savaliya , linux-kernel@vger.kernel.org References: <20201008225235.2035820-1-dianders@chromium.org> <20201008155154.1.Ifdb1b69fa3367b81118e16e9e4e63299980ca798@changeid> <160229038385.310579.7502548054994849649@swboyd.mtv.corp.google.com> From: Akash Asthana Message-ID: <2ccc26a0-5d54-e06c-5a73-7eb353c393d2@codeaurora.org> Date: Mon, 12 Oct 2020 14:35:23 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <160229038385.310579.7502548054994849649@swboyd.mtv.corp.google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephen, >> >> static void geni_se_select_dma_mode(struct geni_se *se) >> { >> + u32 proto = geni_se_read_proto(se); >> u32 val; >> >> geni_se_irq_clear(se); >> >> + val = readl_relaxed(se->base + SE_GENI_M_IRQ_EN); >> + if (proto != GENI_SE_UART) { > Not a problem with this patch but it would be great if there was a > comment here (and probably in geni_se_select_fifo_mode() too) indicating > why GENI_SE_UART is special. Is it because GENI_SE_UART doesn't use the > main sequencer? I think that is the reason, but I forgot and reading > this code doesn't tell me that. > > Splitting the driver in this way where the logic is in the geni wrapper > and in the engine driver leads to this confusion. GENI_SE_UART uses main sequencer for TX and secondary for RX transfers because it is asynchronous in nature. That's why  RX related bits (M_RX_FIFO_WATERMARK_EN | M_RX_FIFO_LAST_EN)  are not enable in main sequencer for UART. (M_CMD_DONE_EN | M_TX_FIFO_WATERMARK_EN) bits are controlled from UART driver, it's gets enabled and disabled multiple times from start_tx ,stop_tx respectively. Regards, Akash > >> + val &= ~(M_CMD_DONE_EN | M_TX_FIFO_WATERMARK_EN); >> + val &= ~(M_RX_FIFO_WATERMARK_EN | M_RX_FIFO_LAST_EN); >> + } >> + writel_relaxed(val, se->base + SE_GENI_M_IRQ_EN); >> + >> + val = readl_relaxed(se->base + SE_GENI_S_IRQ_EN); >> + if (proto != GENI_SE_UART) >> + val &= ~S_CMD_DONE_EN; >> + writel_relaxed(val, se->base + SE_GENI_S_IRQ_EN); >> + >> val = readl_relaxed(se->base + SE_GENI_DMA_MODE_EN); >> val |= GENI_DMA_MODE_EN; >> writel_relaxed(val, se->base + SE_GENI_DMA_MODE_EN); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project