Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3796924ybi; Mon, 29 Jul 2019 12:48:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuGHMzsUBtcFFo+3tH7rJ3Rz7ZN5b0fU1dzbn1Jzz/vwmsnM24KyvXg/pPbt60uqo+6Fw/ X-Received: by 2002:a63:4c5a:: with SMTP id m26mr103913697pgl.270.1564429730266; Mon, 29 Jul 2019 12:48:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429730; cv=none; d=google.com; s=arc-20160816; b=AHylPVrdBO9iaVRkidNV4uTIYXtun7pICpEkaK0Irpafa4zM4IsZ+XuhlhR28O/dWI DVurM3f1FO6pwV+ZBtuYk85Hq8G20ec3ab3cGBA+fwh5vu7w3gmmDc48vNr7Wgo7pEyO HKhUN7UpSz7YID7PIpU3upJJcIoONhxkyrcwl86UcAEBl2itb1fmbFdreBPfmXPgfXjQ AmJwy2y5nCdoL4/Sj68uLzjDpPawpmgB4zCBznwVO1ifoci8Ijh/ir2YzWcJIE/9qRtt u9V1/URYaYZTptyavvfjgLIz7MwmRh2mSsEYLsOtxVpvjdkSiqyiyxADDji+8Glhbtws p4Eg== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=f8Yn9RIpBc3Gf+3wC1B/8EVuYmI09om1WirTShFYSjU=; b=Gv5MEKSf13QpSz2eRrf0RdPdmVUXRCjn240o3hL/3EdmT7FmKqqruw3hPBt5zQPoB/ +4UDJZoaT7mqZoIuyNJrvUPi1QFAM7GJdAUoJ0uedsdBqYZAoa7pTFls2YINZ6gxf2to h7NQzlnX5wJhRUemjb1zdj/dC6uPvsm49n3zLlpY4AWDoaU4XuCnb1CN5gow9hkOOAMw RLPPw+fbrZdzpW+LnzWHg3KmAn9LRnrcrVanLQWCNW8uwoxpFGYhPUtLGHXR8+bNzLht iiktu0fzkc6LefyTiXiGzL5urkKc+Koj7O+Gv1RecYXiKjhVdxpcuoQuM46quLaKU4HH X1AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="KNP53x/R"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11si25924188pls.148.2019.07.29.12.48.35; Mon, 29 Jul 2019 12:48:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="KNP53x/R"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390324AbfG2TrX (ORCPT + 99 others); Mon, 29 Jul 2019 15:47:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:36864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389655AbfG2TrN (ORCPT ); Mon, 29 Jul 2019 15:47:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D85A20C01; Mon, 29 Jul 2019 19:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429632; bh=x3F5MHr1q7jvsB8uY933ck27RJqdre2V7LjldOkB+Gc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KNP53x/R3LmhCvJWMt2DQN3QHrj1dsE4sd1uw671ivKpzB/DFYSdLPPdiPnZsO8cq QYYSb9nHYOZ1mxCWQqLwpWNrH3/b6xudXPcz7XR6SOgfjAaCZC6vtol5ayxIDyUkMG PpObnNXtYzmuoGfxQDTj6h1i+3QkP2kcMZMvOsYI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ajay Gupta , Wolfram Sang , Sasha Levin Subject: [PATCH 5.2 046/215] i2c: nvidia-gpu: resume ccgx i2c client Date: Mon, 29 Jul 2019 21:20:42 +0200 Message-Id: <20190729190748.512268779@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 9f2e244d0a39eb437f98324ac315e605e48636db ] Cypress USB Type-C CCGx controller firmware version 3.1.10 (which is being used in many NVIDIA GPU cards) has known issue of not triggering interrupt when a USB device is hot plugged to runtime resume the controller. If any GPU card gets latest kernel with runtime pm support but does not get latest fixed firmware then also it should continue to work and therefore a workaround is required to check for any connector change event The workaround is to request runtime resume of i2c client which is UCSI Cypress CCGx driver. CCG driver will call the ISR for any connector change event only if NVIDIA GPU has old CCG firmware with the known issue. Signed-off-by: Ajay Gupta Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-nvidia-gpu.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c-nvidia-gpu.c index 1c8f708f212b..ee2412b7459c 100644 --- a/drivers/i2c/busses/i2c-nvidia-gpu.c +++ b/drivers/i2c/busses/i2c-nvidia-gpu.c @@ -51,6 +51,7 @@ struct gpu_i2c_dev { void __iomem *regs; struct i2c_adapter adapter; struct i2c_board_info *gpu_ccgx_ucsi; + struct i2c_client *ccgx_client; }; static void gpu_enable_i2c_bus(struct gpu_i2c_dev *i2cd) @@ -261,8 +262,6 @@ static const struct property_entry ccgx_props[] = { static int gpu_populate_client(struct gpu_i2c_dev *i2cd, int irq) { - struct i2c_client *ccgx_client; - i2cd->gpu_ccgx_ucsi = devm_kzalloc(i2cd->dev, sizeof(*i2cd->gpu_ccgx_ucsi), GFP_KERNEL); @@ -274,8 +273,8 @@ static int gpu_populate_client(struct gpu_i2c_dev *i2cd, int irq) i2cd->gpu_ccgx_ucsi->addr = 0x8; i2cd->gpu_ccgx_ucsi->irq = irq; i2cd->gpu_ccgx_ucsi->properties = ccgx_props; - ccgx_client = i2c_new_device(&i2cd->adapter, i2cd->gpu_ccgx_ucsi); - if (!ccgx_client) + i2cd->ccgx_client = i2c_new_device(&i2cd->adapter, i2cd->gpu_ccgx_ucsi); + if (!i2cd->ccgx_client) return -ENODEV; return 0; @@ -354,6 +353,13 @@ static __maybe_unused int gpu_i2c_resume(struct device *dev) struct gpu_i2c_dev *i2cd = dev_get_drvdata(dev); gpu_enable_i2c_bus(i2cd); + /* + * Runtime resume ccgx client so that it can see for any + * connector change event. Old ccg firmware has known + * issue of not triggering interrupt when a device is + * connected to runtime resume the controller. + */ + pm_request_resume(&i2cd->ccgx_client->dev); return 0; } -- 2.20.1