Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1439401pxj; Fri, 21 May 2021 14:28:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZo6mT/rqmyUYTChFZ7FbFQRehOOAHAGKNAYfXRJl2fpjjugHOQRWdelbgyAvgyb8rJgJp X-Received: by 2002:a05:6e02:12e5:: with SMTP id l5mr1171151iln.6.1621632489098; Fri, 21 May 2021 14:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621632489; cv=none; d=google.com; s=arc-20160816; b=FEm93S8ci6HQQh3ioiI600CjJ12PTUv8I5TC/Vc3YKoGb2h1byoO54ylJ4n4CQAJS3 fhhngvWpktGh6UP2pgxl5/RQkfl5JfAp6G/FpVkgkYds/S3Wte2yV0VpdM7IgobPwsSe gflWQHDF6G2PfZML8uiWsdXIfEu+9iT+Vu+jAhjxmFWxQjIIcbYWZTqgKpmndQMQqsI5 fjxPxiSXvQ+zCaI5bZzgRVP5nL9wPkNQPbwU4YdO2ZcTqtLN4Mfdh7wKWLb6cCl8SrIP RN19eAfMnO1fcPAkXrShZ3Xof1RgYYhhA0rmyrCmcSdWk5Sb9eglKPRWLzaDm4YJ8tXH /qqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=FyO/JqUhnAJn7rTfn8HMrxZKns8UrOKW6CCN24xNmJw=; b=zfXAivKjH9C9jJtSQuHeL9DTCx+YJ2l/2Xn/8mrgHbsBIXx9JtkQDJJgrT4ny0VkHW inCwX5tMFwl+amzlptD9IcYjb16782tZYfRo8Z+jXSeG4lBCxg+PI9RN/zcUYvLPSwUC fUpMI8K/nE3ZOch/hrN0A7xsi6L5KnMO13y4m6hMRcMjjsNF8dxxL9pXo22F5cRmBKwc hzIfhLb+6zoBlyyEp51R9S5UAjBnE29H2r45NTkFruuqzct7bGvyOn6usYdmJsWb6L60 8k7dzbfBc7v0dxb4JzILO9iyi0RvCKzGmvWMUMlTf75K5QfcIaNP3nHPN2VTr7RJLNNU scFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kk8gvTxu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d8si6626863iob.68.2021.05.21.14.27.56; Fri, 21 May 2021 14:28:09 -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=@chromium.org header.s=google header.b=kk8gvTxu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236808AbhEUTWR (ORCPT + 99 others); Fri, 21 May 2021 15:22:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235521AbhEUTWQ (ORCPT ); Fri, 21 May 2021 15:22:16 -0400 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16020C0613ED for ; Fri, 21 May 2021 12:20:53 -0700 (PDT) Received: by mail-oi1-x229.google.com with SMTP id c196so12452390oib.9 for ; Fri, 21 May 2021 12:20:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=FyO/JqUhnAJn7rTfn8HMrxZKns8UrOKW6CCN24xNmJw=; b=kk8gvTxu2F6FrdI0CCGAN+iKSWE0a9uhN0j8qo4IKMjr/VC0lIWL6XiOgDlPtdF623 CgDQ0MAS2Pwe7I6Co6Q5OklTQ+cAJo60nXf1pusd86wdqCtcV96QXgcee72pWHjB8o5n Af1Aiyu/o9TW7ARVZ+cMLA+XgrXvJbMpY7BXE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=FyO/JqUhnAJn7rTfn8HMrxZKns8UrOKW6CCN24xNmJw=; b=gYxTqBvbNVzcq2mk1Oht/8KOJbjDF1+cttS13TZ64NORa1W2v1nFcwMJ3AWtuDiG+m ianwTSGOsjswJDXyip82u27ooXH7FaIVcc3o4Ty9i31GR97WMwp0JL4JELbxEdjIvuZo x8fvBQKv6iSjaaqkSGFJ3rEca3BrItbU93lEp8itIHuoAIvK0j1OJKIWoyyyUDbgkoMF riJMs7iE6lxoV/KRdjrXVPqNvwxea58Cq6gRxLHWVsEq8o1y0RuHDtVOSZ0Mm91h5MKk KipvYFr6dTANbIENEFauW7ei99kI3qNb/dicu4tXD7ab9xG7IeNbWwvRiM7z1Tqdr5Ke UTzg== X-Gm-Message-State: AOAM533HWLRx5eNzFhZZOvQe5DJuz3fKPMPrRCiAYosZBmTM1WOfee/L Wf/G2i8ENauqnJLTwGwhQEIH8AnUFSqz28QqMVB3LA== X-Received: by 2002:a54:4501:: with SMTP id l1mr3318840oil.19.1621624852348; Fri, 21 May 2021 12:20:52 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 21 May 2021 12:20:51 -0700 MIME-Version: 1.0 In-Reply-To: <79fdd08e974d6f6e35f0042c98a9415c@codeaurora.org> References: <20210512082220.7137-1-rojay@codeaurora.org> <70a90d229551bcec21ed74cfd1350b9b@codeaurora.org> <79fdd08e974d6f6e35f0042c98a9415c@codeaurora.org> From: Stephen Boyd User-Agent: alot/0.9.1 Date: Fri, 21 May 2021 12:20:51 -0700 Message-ID: Subject: Re: [PATCH V10] i2c: i2c-qcom-geni: Add shutdown callback for i2c To: rojay@codeaurora.org Cc: wsa@kernel.org, dianders@chromium.org, saiprakash.ranjan@codeaurora.org, gregkh@linuxfoundation.org, mka@chromium.org, skananth@codeaurora.org, msavaliy@qti.qualcomm.com, skakit@codeaurora.org, rnayak@codeaurora.org, agross@kernel.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, sumit.semwal@linaro.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting rojay@codeaurora.org (2021-05-21 09:12:02) > > Yes, we cannot mark device as suspended/resumed during > runtime PM operations. Bus will be resumed during i2c > transfers and before transfer initiation, in __i2c_transfer() > from i2c-core-base.c there is a check to see whether the device > is marked as suspended with "__i2c_check_suspended(adap)" call, > which is "true" in this case and returning from there. > > To mark it only suspended during system wide suspend/resume > transitions, currently our geni i2c driver has only > system_suspend implemented (geni_i2c_suspend_noirq()) and > does not have system_resume implemented, which again causes i2c > transfers to fail during system_resume after system_suspend. Got it. > > Shall I go ahead with marking device suspended during > shutdown() only? > Yes that sounds good. Can you send two patches, one to mark suspend in the system PM paths and one in the shutdown path? There are various bugs to fix in other drivers that are trying to use the i2c bus after it has been suspended and shutdown, but that doesn't block these patches from moving forward. I'll take a look and see what's going on with suspend/resume on my board.