Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4474697ybz; Tue, 28 Apr 2020 11:55:52 -0700 (PDT) X-Google-Smtp-Source: APiQypJqv+oO6qkNNfO0WJzX9kmgNKN6LOFH9Vlrwvf/nKbXSqH++4eApKAMfd8NyyOzWo6FO9OL X-Received: by 2002:a17:906:3e96:: with SMTP id a22mr26409708ejj.232.1588100152053; Tue, 28 Apr 2020 11:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588100152; cv=none; d=google.com; s=arc-20160816; b=ovF6C3eCfK+60Lo6qJlriBt8Hjs+8gvZUkUm2UXXdeqgtnAbcemb/gYNOb9gWaetkF UULuk8/aPM6vMBupuIG/DG4gjtkazSZOV+zn8ECVrRzkht79REX+aIgpscNAJD4cppr5 k2/RLhiJ7RB/niEcOaaxSx3+YnKY1nwoKQjNIbE+Hr5JwyWbBRkDsMJchnNS8QPkIS+/ mVCt+ufKbEjybDKQynOHGJjcu9SYzncLyEhS9knvV7x4JucgXDFPY0s7xxAkqDHu9a66 P+B+dPxtdPU4c0s3wf+BI2XU63sEx8sYOH8lZ7fk0apEgMxsGCUCRVIHaNawOS4Q2XXU j0Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature; bh=0e4Q4kCLbMcxnWJZ9yvWd0DliCAIiPdcXMbvbzquWlY=; b=LRgtarhSA2RaoQStw1SHV9Vrsoyyb95YfB4HMLa7xzVBW+2bcGrhOMywUlwqcooalx H5U0RZ0Wb65z2AaNHeseGMp9MDHTVi8TFG46d8CI9HJAHRF41ytRyFfq6i5HWi7uldxF HJSWK16/OMbeSWV65rtZvFp0ZzU7pDa79W3i6Gtu9reBXgPwktnPnfvmXY7+3rK/1hdA MHoXC8InjfcvR4+uAsdfwH5AwX0YBOR6e6B/DV+RxyymGehTl1MC9tK3zC6Qj+NGB4CD n6J3y0HbkJkjagP+hypDmHAKOEu97hRDZCsAzlO4b78W8Ximt+CQ5LiiQ68veJZ4Py6+ qVyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=rVn+LZSx; 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 d23si2082053edn.363.2020.04.28.11.55.27; Tue, 28 Apr 2020 11:55:52 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=rVn+LZSx; 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 S1730345AbgD1SyK (ORCPT + 99 others); Tue, 28 Apr 2020 14:54:10 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:53225 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730064AbgD1SyH (ORCPT ); Tue, 28 Apr 2020 14:54:07 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1588100046; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=0e4Q4kCLbMcxnWJZ9yvWd0DliCAIiPdcXMbvbzquWlY=; b=rVn+LZSxekQBZLbZGWUzo7+fII4zQYk/TKy1Io8DW7SnNhyZH9vGWB8Mfqo1zFleGMYjKKU3 cnMJrZ1nMABbQGu0PZqHnL0VDJBhD417W+pOTYae81amBuCMVTKPpF+Bcpe2fWMRcpsA2/+A KDNukBp+r/xtIqX2GEfXCgkIMro= X-Mailgun-Sending-Ip: 104.130.122.26 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 mxa.mailgun.org with ESMTP id 5ea87bce.7fef5834e458-smtp-out-n04; Tue, 28 Apr 2020 18:54:06 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 21E0DC43637; Tue, 28 Apr 2020 18:54:05 +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=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [10.46.162.249] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: hemantk) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4C94AC433D2; Tue, 28 Apr 2020 18:54:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4C94AC433D2 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=none smtp.mailfrom=hemantk@codeaurora.org Subject: Re: [PATCH v3 2/6] bus: mhi: core: Remove link_status() callback To: Jeffrey Hugo , manivannan.sadhasivam@linaro.org Cc: bbhatt@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <1588003153-13139-1-git-send-email-jhugo@codeaurora.org> <1588003153-13139-3-git-send-email-jhugo@codeaurora.org> From: Hemant Kumar Message-ID: Date: Tue, 28 Apr 2020 11:54:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1588003153-13139-3-git-send-email-jhugo@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/27/20 8:59 AM, Jeffrey Hugo wrote: > If the MHI core detects invalid data due to a PCI read, it calls into > the controller via link_status() to double check that the link is infact > down. All in all, this is pretty pointless, and racy. There are no good > reasons for this, and only drawbacks. > > Its pointless because chances are, the controller is going to do the same > thing to determine if the link is down - attempt a PCI access and compare > the result. This does not make the link status decision any smarter. > > Its racy because its possible that the link was down at the time of the > MHI core access, but then recovered before the controller access. In this > case, the controller will indicate the link is not down, and the MHI core > will precede to use a bad value as the MHI core does not attempt to retry > the access. > > Retrying the access in the MHI core is a bad idea because again, it is > racy - what if the link is down again? Furthermore, there may be some > higher level state associated with the link status, that is now invalid > because the link went down. > > The only reason why the MHI core could see "invalid" data when doing a PCI > access, that is actually valid, is if the register actually contained the > PCI spec defined sentinel for an invalid access. In this case, it is > arguable that the MHI implementation broken, and should be fixed, not > worked around. > > Therefore, remove the link_status() callback before anyone attempts to > implement it. > > Signed-off-by: Jeffrey Hugo > Reviewed-by: Manivannan Sadhasivam > --- Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project