From patchwork Mon Feb 17 21:58:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 24798 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AE7EB20143 for ; Mon, 17 Feb 2014 21:59:03 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wp4sf60940063obc.1 for ; Mon, 17 Feb 2014 13:59:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Us/ikxfPxmCpkwTk+WS8bInIJwgedTF6G29c5DoZwt0=; b=iFackIr5F4ECacX18BjZuP4rfBrwRDk+LDwhCHCb8MN7kjipBHXQSVo8Fcjfys0XlE z2wvWs5CXIgJ9g/bFtsMKgWcq4sqGY5QpoJB92/eAuueShcL+UdcAAYnOxn/PnO+3MEn GKVB2AkEHL++2sXDA3wdhyDXOyF7xTUE5BULrjue57MCAF5CCHr/RIsi7ppErqpOgL6e CvnBNExbEIxng7rqI8HgFUZp/Sv7SUc2K+c/RqeHsdU+Xnxj4vLHwb7eOFMpK2fmm4YX EWnc0yU4IkGZFZt8MWTcoe4sTW7MwZdYAKVEGOWuqP6UlHbSATHrS1IIpqjqnWy/9BTI WWtA== X-Gm-Message-State: ALoCoQkqGx6SSWbXRuxX+yR0yDUawYH/VMa1cDQcz88aKcdrf65hk9/tp1tt9fEo2iQkbR4wJIzU X-Received: by 10.42.107.67 with SMTP id c3mr10302898icp.0.1392674342798; Mon, 17 Feb 2014 13:59:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.98 with SMTP id b89ls1158711qgd.9.gmail; Mon, 17 Feb 2014 13:59:02 -0800 (PST) X-Received: by 10.220.109.1 with SMTP id h1mr14627082vcp.20.1392674342650; Mon, 17 Feb 2014 13:59:02 -0800 (PST) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id w5si4823826vcn.101.2014.02.17.13.59.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 13:59:02 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id cz12so12849544veb.15 for ; Mon, 17 Feb 2014 13:59:02 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr18693923vco.18.1392674342577; Mon, 17 Feb 2014 13:59:02 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp169522vcz; Mon, 17 Feb 2014 13:59:02 -0800 (PST) X-Received: by 10.68.176.65 with SMTP id cg1mr6202056pbc.145.1392674341627; Mon, 17 Feb 2014 13:59:01 -0800 (PST) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by mx.google.com with ESMTPS id tq5si16101834pac.8.2014.02.17.13.59.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 13:59:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.169 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.192.169; Received: by mail-pd0-f169.google.com with SMTP id v10so15429483pde.28 for ; Mon, 17 Feb 2014 13:59:01 -0800 (PST) X-Received: by 10.66.166.175 with SMTP id zh15mr28982937pab.36.1392674341176; Mon, 17 Feb 2014 13:59:01 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id x5sm49045254pbw.26.2014.02.17.13.58.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 13:59:00 -0800 (PST) From: John Stultz To: LKML Cc: Laura Abbott , Greg KH , Colin Cross , Android Kernel Team , Mitchel Humpherys , John Stultz Subject: [PATCH 07/14] staging: ion: Fix debugfs handling of multiple kernel clients Date: Mon, 17 Feb 2014 13:58:35 -0800 Message-Id: <1392674322-9036-8-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392674322-9036-1-git-send-email-john.stultz@linaro.org> References: <1392674322-9036-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Laura Abbott Currently, Ion registers all debugfs entries for clients via pid. If there are multiple kernel clients, this means the debugfs entry only gets created for the first one. Fix this by creating debugfs entries by name always. When creating user clients, specify the name via the pid. Cc: Greg KH Cc: Colin Cross Cc: Android Kernel Team Signed-off-by: Laura Abbott Signed-off-by: Mitchel Humpherys [jstultz: Minor commit subject tweaks] Signed-off-by: John Stultz --- drivers/staging/android/ion/ion.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 8f6bdb7..4869420 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -719,7 +719,6 @@ struct ion_client *ion_client_create(struct ion_device *dev, struct rb_node **p; struct rb_node *parent = NULL; struct ion_client *entry; - char debug_name[64]; pid_t pid; get_task_struct(current->group_leader); @@ -764,15 +763,14 @@ struct ion_client *ion_client_create(struct ion_device *dev, rb_link_node(&client->node, parent, p); rb_insert_color(&client->node, &dev->clients); - snprintf(debug_name, 64, "%u", client->pid); - client->debug_root = debugfs_create_file(debug_name, 0664, + client->debug_root = debugfs_create_file(name, 0664, dev->clients_debug_root, client, &debug_client_fops); if (!client->debug_root) { char buf[256], *path; path = dentry_path(dev->clients_debug_root, buf, 256); pr_err("Failed to create client debugfs at %s/%s\n", - path, debug_name); + path, name); } up_write(&dev->lock); @@ -1301,9 +1299,11 @@ static int ion_open(struct inode *inode, struct file *file) struct miscdevice *miscdev = file->private_data; struct ion_device *dev = container_of(miscdev, struct ion_device, dev); struct ion_client *client; + char debug_name[64]; pr_debug("%s: %d\n", __func__, __LINE__); - client = ion_client_create(dev, "user"); + snprintf(debug_name, 64, "%u", task_pid_nr(current->group_leader)); + client = ion_client_create(dev, debug_name); if (IS_ERR(client)) return PTR_ERR(client); file->private_data = client;