From patchwork Mon Feb 3 18:16:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 24052 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f69.google.com (mail-pb0-f69.google.com [209.85.160.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6434B202B2 for ; Mon, 3 Feb 2014 18:16:49 +0000 (UTC) Received: by mail-pb0-f69.google.com with SMTP id md12sf19060009pbc.4 for ; Mon, 03 Feb 2014 10:16:48 -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=F0iu0TakK4xrM9FtZlYDoB+2UJIhRIeV9pPWv0DzHXA=; b=EvObjZWnZua2Nw92QpRIzYW+z15IN+hcPRnnXWWPZjZc0V63x6kRtg7Gxtwa6U1ISF DOUjpJcdOmPubRtrGBCMKwKHv2+E7YYKz5r+J9HNTOi0Sfz0Et3T48TSA6S11/MGHlzU A7II4B5Hb/5HwPLuvvnnnDYNph9GSeqOuqBTJ1PyL4cHs1sK+hL/F8F82UoXLhybvp3l 17gGNOIxkKYEHqVIdBZXIYVMHF+AffMrm2bR15BnbPhBGQZT1eM2011bIFJz/ssI61Jo BdPVqJh5Ar6s/5nCwZ+oaHPUk/XraBuFy3MyN8meG3vZgfqQ68DcUd7mJKnYHyC5AJZE SCfg== X-Gm-Message-State: ALoCoQkeyhsiIECuC2BrkQxD/1xUp0fRztNWyGb9NTo6znpxNoEcZmJONM39TJvJsddYXnR1CVjb X-Received: by 10.66.163.67 with SMTP id yg3mr2706020pab.45.1391451408675; Mon, 03 Feb 2014 10:16:48 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.139 with SMTP id 11ls2015697qgn.84.gmail; Mon, 03 Feb 2014 10:16:48 -0800 (PST) X-Received: by 10.220.99.72 with SMTP id t8mr29661137vcn.10.1391451408500; Mon, 03 Feb 2014 10:16:48 -0800 (PST) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id cy15si7029411veb.106.2014.02.03.10.16.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Feb 2014 10:16:48 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.172 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.172; Received: by mail-ve0-f172.google.com with SMTP id c14so5165205vea.17 for ; Mon, 03 Feb 2014 10:16:48 -0800 (PST) X-Received: by 10.52.76.105 with SMTP id j9mr149523vdw.52.1391451408412; Mon, 03 Feb 2014 10:16:48 -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 u4csp174181vcz; Mon, 3 Feb 2014 10:16:47 -0800 (PST) X-Received: by 10.68.143.34 with SMTP id sb2mr29125550pbb.135.1391451407480; Mon, 03 Feb 2014 10:16:47 -0800 (PST) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by mx.google.com with ESMTPS id vb2si21495539pbc.217.2014.02.03.10.16.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Feb 2014 10:16:47 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.182 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.192.182; Received: by mail-pd0-f182.google.com with SMTP id v10so7127490pde.41 for ; Mon, 03 Feb 2014 10:16:47 -0800 (PST) X-Received: by 10.66.188.203 with SMTP id gc11mr38379466pac.63.1391451406964; Mon, 03 Feb 2014 10:16:46 -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 y9sm150496099pas.10.2014.02.03.10.16.45 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Feb 2014 10:16:46 -0800 (PST) From: John Stultz To: LKML Cc: Laura Abbott , Greg KH , Colin Cross , Android Kernel Team , Mitchel Humpherys , John Stultz Subject: [PATCH 10/16] staging: ion: Fix debugfs handling of multiple kernel clients Date: Mon, 3 Feb 2014 10:16:22 -0800 Message-Id: <1391451388-23906-11-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1391451388-23906-1-git-send-email-john.stultz@linaro.org> References: <1391451388-23906-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.172 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 df1507c..684f240 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -718,7 +718,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); @@ -763,15 +762,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); @@ -1302,9 +1300,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;