From patchwork Fri Feb 15 10:40:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 158504 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp546664jaa; Fri, 15 Feb 2019 02:40:54 -0800 (PST) X-Google-Smtp-Source: AHgI3IZszV5ao/jTha/qOK2KLHSkvpYJSIvBPhOlgyEye3zQW7LXZwLrVulJJxADX8L9UB/KL9Kv X-Received: by 2002:a63:2882:: with SMTP id o124mr4795381pgo.446.1550227254480; Fri, 15 Feb 2019 02:40:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550227254; cv=none; d=google.com; s=arc-20160816; b=ncEIw/+T5MF7SuQG/1d9SQ/+V6Oy/sE0iwOvG7k+a2s8KkfVdn2eJvWajPKI0b3A3q uWS/raOVDKHP8785zjeUSEGjMEwaPD89MpmkLjs8f719+ahKaw+Fg1dETacnuRyLVRYS /xxtc653HzfYPGH3P9WJGk2TsxoM0WJfPVZ+xZIQj3FaTUc0WRwCc9roeWE6hwYQXZ+o LYk8EpPcw6Q/KIdboz7ZxyAvx4UTEbeNsYlFn1xM4pmhu2QEJsEBjLMAkaP4vusTfd1L BWIQ3iQLcW9PbbTjIu3TnsUoo1fUAN15WAo2RB251KdMNgeyZBHPTv1UDIpgnIVU57Y8 x4rA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Z0yitGNScO3IMqqGpNFQGrqpaVO41izEagUP+rK/RW0=; b=yn45s5SlZR1ZvE4JNhR21ZIqpmlIhtSYVg1jUaONw36Z7ZvkSp0W4cBjqG9Wbtmz5t QD4krWRZviA2rzD7aBo51xH1+CcTgezBy3eOyfugrvCLL7M+iCNjFaht/0emF3+RBmIR O31qSKH7IoKxvWcy5zTssi4iZRWPKkxmYs+LG3SemECyhIIgoZ5VOyzQt6rj+YHnUglT SqRpOOLKUOGOT9/pWK0Y2nwJYEyMyHxkTOrms3pqU4UVb/zbjykrsytK92s1lSSoYH51 PZc/fcQqCkO52LT98ZsyxdujEq9FFWin/rvmjPPqXxvbxdiURW+fRXq78aTm1C309n1o 55Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Eqshanoj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x64si5302905pfx.87.2019.02.15.02.40.54; Fri, 15 Feb 2019 02:40:54 -0800 (PST) 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=@linaro.org header.s=google header.b=Eqshanoj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405756AbfBOKkw (ORCPT + 31 others); Fri, 15 Feb 2019 05:40:52 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43657 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405686AbfBOKks (ORCPT ); Fri, 15 Feb 2019 05:40:48 -0500 Received: by mail-wr1-f68.google.com with SMTP id r2so9771385wrv.10 for ; Fri, 15 Feb 2019 02:40:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z0yitGNScO3IMqqGpNFQGrqpaVO41izEagUP+rK/RW0=; b=EqshanojYFFhuFNfGt/bKnBYOSX0wxmtWHR7LzmBDusYiy5PxKR06tjoZwQiqiBcgS 6/08mcP1PeD0G+Enem4/2+db3IbSkr3qhhUI6tFXFr0f2VmgIm85iy/lPuR9nTnMc4gm SWT72HgFf13ckiQzDsoUt19ePaAxmZhfm2DqQQUR32HvLp3KKncFZ1Z50fLuTtgOMpXv q2fvtDyXzjU/P5v2Wz7D7FtzRDG9ojs39knu2H8fCKRm3oqxB5/PG1txdoZVKr6QenWT GP8fGBSa+sa/JFHbXqUjRapNk3IQzm5XRXSAQBOgekojnX2omyOcBI+n5SlXEp6D2KKK Rhww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Z0yitGNScO3IMqqGpNFQGrqpaVO41izEagUP+rK/RW0=; b=rov3scas0cvy5GXZj0du4vNVK3qqw7KhB26GydfyC+P9L2h4+atANWjkKndWH50eAv UeAKYbp6Cy5p5FkmHavn2hie3VLRCJ5Vx8rTzh4Dg7oVRCO+H0xUkUvdnYRFWS8RvIqS B+fC6lgR++W8XNPYtbzLXcKuxdEqrUj/fMxhJiaLKxPt8wvD3pfTZS83QI8zWVQ/3OGu 3ViTZsR4J+OlQSq/gp9RVaNqF17cRmIkPPIcLaxELiZe4sq8tKt3kE3NAC5vwZirskQ1 LWT1awMTYrPzEF0lfkKDxTO+KzxXZoAvAMrnHg7AKRDpCuHpAypoKX1DmxY4zmt6pe4Q tHHw== X-Gm-Message-State: AHQUAubJjqS+K2b1GVNdqAJLaqvFnoNJnzk63AfE3/I+Bs13ELVE6Fdw ca4oqonTX7DhEJR3ePDDtmyr1IhfJYg= X-Received: by 2002:adf:fecd:: with SMTP id q13mr6318933wrs.3.1550227246976; Fri, 15 Feb 2019 02:40:46 -0800 (PST) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id v4sm6525577wme.6.2019.02.15.02.40.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:40:46 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-next@vger.kernel.org, Srinivas Kandagatla , Randy Dunlap Subject: [PATCH 1/2] misc: fastrpc: select CONFIG_DMA_SHARED_BUFFER Date: Fri, 15 Feb 2019 10:40:06 +0000 Message-Id: <20190215104007.27103-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190215104007.27103-1-srinivas.kandagatla@linaro.org> References: <20190215104007.27103-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fastrpc is a dma buf exporter as well, so select the corresponding DMA_SHARED_BUFFER config to fix below compilation errors on platforms without this config. ld: drivers/misc/fastrpc.o: in function 'fastrpc_free_map': fastrpc.c:(.text+0xbe): undefined reference to 'dma_buf_unmap_attachment' ld: fastrpc.c:(.text+0xcb): undefined reference to 'dma_buf_detach' ld: fastrpc.c:(.text+0xd4): undefined reference to 'dma_buf_put' ld: drivers/misc/fastrpc.o: in function 'fastrpc_map_create': fastrpc.c:(.text+0xb2b): undefined reference to 'dma_buf_get' ld: fastrpc.c:(.text+0xb47): undefined reference to 'dma_buf_attach' ld: fastrpc.c:(.text+0xb61): undefined reference to 'dma_buf_map_attachment' ld: fastrpc.c:(.text+0xc36): undefined reference to 'dma_buf_put' ld: fastrpc.c:(.text+0xc48): undefined reference to 'dma_buf_detach' ld: drivers/misc/fastrpc.o: in function 'fastrpc_device_ioctl': fastrpc.c:(.text+0x1756): undefined reference to 'dma_buf_get' ld: fastrpc.c:(.text+0x1776): undefined reference to 'dma_buf_put' ld: fastrpc.c:(.text+0x1780): undefined reference to 'dma_buf_put' ld: fastrpc.c:(.text+0x1abf): undefined reference to 'dma_buf_export' ld: fastrpc.c:(.text+0x1ae7): undefined reference to 'dma_buf_fd' ld: fastrpc.c:(.text+0x1cb5): undefined reference to 'dma_buf_put' ld: fastrpc.c:(.text+0x1cca): undefined reference to 'dma_buf_put' Reported-by: Randy Dunlap Signed-off-by: Srinivas Kandagatla --- drivers/misc/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 Acked-by: Randy Dunlap # build-tested diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 7e0726253755..53cd16f795d6 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -299,6 +299,7 @@ config QCOM_FASTRPC tristate "Qualcomm FastRPC" depends on ARCH_QCOM || COMPILE_TEST depends on RPMSG + select DMA_SHARED_BUFFER help Provides a communication mechanism that allows for clients to make remote method invocations across processor boundary to From patchwork Fri Feb 15 10:40:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 158505 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp546747jaa; Fri, 15 Feb 2019 02:41:01 -0800 (PST) X-Google-Smtp-Source: AHgI3IbojeR94joryLBA3bm95IHILoIksDwm+Ssel6abmDqV6NkAKnjrd3uid/kziwXwh0aryUKB X-Received: by 2002:a17:902:8a8a:: with SMTP id p10mr9595174plo.50.1550227261472; Fri, 15 Feb 2019 02:41:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550227261; cv=none; d=google.com; s=arc-20160816; b=nvcshUt1AwHfKgfVogTpj4TaQlJJtikBjdDPQRxoP0DxEKIBQbINWeTpX2V23lS0Yz IyZ2x/vg7H86p034l5DQJcb7zQpQpf8avQtWbx5kajyPYslQbVSNQfbP6J6Q2xlvznjD 3pYNc1Fj3EYpQ8scNYRV9iwn/WbWC27EaHrYsDNJVq4h4D1/e3frdeMC5eFEZo50Rnw9 +FvbKkVgcTU4i/e0BXcbC8IUfCP9BT9oBznTSlhBSDxeyuQV+BgHdx6vSDE4cLGgHEZU lhEHErWce1orR2eE8UboabDvt8on4oX3hXoPc/a1n/Iu4pSwW+E7TIyiw4dng89kRc/5 p/og== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=weY+02WyQtYURWgOqk/sehPDo0eed1gHxxbmbDDrodg=; b=NuGxZl50kyqvllRY0CW5oB41F0OLmzDLi0pL4APBYNbr6E8aCIl3dnGliYDEwXpQP7 bW6GAyvWSgJs58twJpGlx5PodXblXDlWbBfcpPCu71baPJSVxt+HvKvzNhceJArmkj1F EzKam8ztcNa2CCm9eMm5h1hZWYXvEn5exivu02fYCK/VD7MvXbkCnfM5hHHvmS7nzMeC dn3DPiTR3XWh3DPzPKHCKTaml0AoDSTrrq5KwsXti1blwNcil/r3L/DYBJwZtk3nKp4H +sGWCO7lGjI6Ivu+d8NVvGgi4bznJU1VILEGelgemnmhW7qm8KKEL4hUJCEFtmA+4FT1 sTpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="f/UVc6Im"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si5468522plw.344.2019.02.15.02.41.01; Fri, 15 Feb 2019 02:41:01 -0800 (PST) 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=@linaro.org header.s=google header.b="f/UVc6Im"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405777AbfBOKk6 (ORCPT + 31 others); Fri, 15 Feb 2019 05:40:58 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51623 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405722AbfBOKkt (ORCPT ); Fri, 15 Feb 2019 05:40:49 -0500 Received: by mail-wm1-f66.google.com with SMTP id b11so9451621wmj.1 for ; Fri, 15 Feb 2019 02:40:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=weY+02WyQtYURWgOqk/sehPDo0eed1gHxxbmbDDrodg=; b=f/UVc6ImQ+JYHzqD6YxuotULEey2fKgeyS3yYswfkwkQ9bkfh0X4X6Udrw3ghBr/f1 XFB9SrcCgYYlzMbn/588tI//Am87IzkoG+Jt1HOOQx/IU28j0D83f3MnGEoDThxzGNfk SB84ayWhGNu/wCM8b6gEl/zfAWk4alNJ11HYh/LI2Exirx8KGMSTVNXJ+Mi7Pe3A+NxW 4fugOhb3MmE1KoYJd1XJL8+2L6o5oAixOvB6RPGUP6f6MEyhBwATkjYrZd8QjWUyg+tL XAWzgyvJvL7XrkF4a8LUtfYVS5OmyUVYXuheANUFw5/nmqICMUhZMyZhLSwp3YTwRfUu IjIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=weY+02WyQtYURWgOqk/sehPDo0eed1gHxxbmbDDrodg=; b=On1XDDv7vvQRIvv7ZZHqbXjMP4tj/cDjZZtyTrAHiPn9WcsUO5zDs37g2/DWr6TcAd qLVsK8FJq3bY9AvtkqUCMq/Mlham0Dt/NDzRs66nwHCKqSMzvbMo0eyLYUkLK/Ft9iPo AjVhjA7+RWn/53jlGrgVUJf0412krlLq+1Ul5tXsHxvsYYFptXG6PHw72ZeFxMtC+MqH QiyjvZ2/Ike5/vo1bp8yrDeCWzGZb+lsr5z9yxoNFTvShndR3Mj91pXydqPcWeCOUuKl Esj89osH4THJi/Aql2GmhPT96uIOw3KgmTZ16d47Pa8jASCdUdmnfl3RUMhOn0pYAuZJ eSQQ== X-Gm-Message-State: AHQUAuaVqgwwv+d7dFRvgUwvxeHCdUfJG/hIT7HJGIKPSmQVswyyv4Ms OuOo03Km+k4V7fnMgSTY2Br7OfBd3B8= X-Received: by 2002:a7b:c3cf:: with SMTP id t15mr5894201wmj.103.1550227248097; Fri, 15 Feb 2019 02:40:48 -0800 (PST) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id v4sm6525577wme.6.2019.02.15.02.40.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:40:47 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-next@vger.kernel.org, Thierry Escande , Srinivas Kandagatla Subject: [PATCH 2/2] misc: fastrpc: Fix device_open when no session is available Date: Fri, 15 Feb 2019 10:40:07 +0000 Message-Id: <20190215104007.27103-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190215104007.27103-1-srinivas.kandagatla@linaro.org> References: <20190215104007.27103-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thierry Escande This change fixes fastrpc_device_open() when no session is available and return an error in such case. Signed-off-by: Thierry Escande Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 4b0db33896df..89aec17738ef 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1016,10 +1016,19 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp) INIT_LIST_HEAD(&fl->user); fl->tgid = current->tgid; fl->cctx = cctx; + + fl->sctx = fastrpc_session_alloc(cctx); + if (!fl->sctx) { + dev_err(&cctx->rpdev->dev, "No session available\n"); + mutex_destroy(&fl->mutex); + kfree(fl); + + return -EBUSY; + } + spin_lock(&cctx->lock); list_add_tail(&fl->user, &cctx->users); spin_unlock(&cctx->lock); - fl->sctx = fastrpc_session_alloc(cctx); return 0; }