Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3351283pxk; Mon, 7 Sep 2020 10:19:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4jT9K/m470r0G7ydQCRbSmd8uEYOjEHYX/CRpiU4jAkxi4gfeWYG43y/sDM6tlimt6loM X-Received: by 2002:aa7:c2d6:: with SMTP id m22mr22383150edp.311.1599499183879; Mon, 07 Sep 2020 10:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599499183; cv=none; d=google.com; s=arc-20160816; b=zuJkHhJiWkvgbM0iNJGm9zna/zZQ1FTPplmx/mZzOLDPjmFgLzR24SP5rx/+XCIi0D bqn/4IczAmJDbozRV/19h61oe3T5RvBBsRzmVNMPzgzarPMhTdSy1DDIRxKp9hi8NsrS ObmU5a7GQKLX89VljFWfboLJlIxWWl4qHxDdOgVSBl1dab6CZsp09xKnzvtnV6roJCLY Bd8jHIzIRcpuDDuqsiIklDdjR5cjWtFj8yBK1Kn2SUN5+kYJyJVZRYB643PPobMGuF3p qc9QPKolR+pZ/0sBNjAaPiEYzD0ctwP9s42FBs9/bsf9jIEj0hwZuJRaTYZiFBMmybT6 YIZA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=q2snNkh/8isrbacTdRT9IDhnNRIGrd/zDDLSV57mtWo=; b=I1p/ty61Oj2PgI0KFytvN1mv4k+IeHM87mPF7hPqQv9qmwkOmcTujP5o6QLNcap7rF iUk5BHXQyscD4APkwwgMC4gCzgzpqosJZKtwgSlCCyYPO2OdvWjYOnr5fodfdPhNCEsW fZzDkgQIFjtJBe43iOMiwPoJM54ZzTLGLQyZ6IFt7iw81UZj1I5CB/hZmB6ZBc9PjsZM bgbO4rCHxK7/KbUzBXLM4Qa8XGB4rxQJnZIS19nPt43gRJdBa8xtkqNjQHTop97o7tnu KJSWdpyI0kDHm5IzkO4w4rOmYE944B2/0BLqck8uvHKH3TSU3pwfMWNbat8cy0IvsshB DE4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marek-ca.20150623.gappssmtp.com header.s=20150623 header.b=jS6SmYPS; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t25si10087133ejs.675.2020.09.07.10.19.21; Mon, 07 Sep 2020 10:19:43 -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=@marek-ca.20150623.gappssmtp.com header.s=20150623 header.b=jS6SmYPS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729746AbgIGRSM (ORCPT + 99 others); Mon, 7 Sep 2020 13:18:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729741AbgIGODe (ORCPT ); Mon, 7 Sep 2020 10:03:34 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AB80C061574 for ; Mon, 7 Sep 2020 07:03:15 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id g3so9823098qtq.10 for ; Mon, 07 Sep 2020 07:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marek-ca.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=q2snNkh/8isrbacTdRT9IDhnNRIGrd/zDDLSV57mtWo=; b=jS6SmYPSNEdaluIHy8psQ+x0EaoWY/zzMAGjW3acEMaHzdOif6FT6C/73RCaAj/T7o PUyD4Xe+iAeDIB3DsPEGlueKllP2Byn6TOu89FCTcYuWVbCIwHFQt8zzdYlh0cFSFwO9 DX1sZSz/LJgrUSNZA1yOpYyIwZWXhVjosq7f3MmAWw2h2E4DrUZDJKJuNR9yw+rfmGUN tJkSix5B93LXh2j1yNmqbod4tQQzqLvyT6ioR/cP1yW5220krHciXXPMVBnmUnHjmr3g tMYPa/9txKNDgXWpzVm/o7oleCydW6pCmawPYZest5DjYHQZ+GhZox6doA8Apf6rVLOB /avg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=q2snNkh/8isrbacTdRT9IDhnNRIGrd/zDDLSV57mtWo=; b=Tp6C8mA0cnbEQxIVM7UOSjRqTQF/EqVl8K8COSYMCX/OmAbmm125IUbGQae/R1a4iW 6xIEwNPHrv4JD43A576LRJU9qShrQvQs5gwgj1kUQmJjImoWeKI91VzD5ZEoaOd0X/NY 0Ci9LYrpv50stEXL1P1z6wFc961YDfjVthJC1z0ElA3deL0Zvwwh6SZCk3zV8yYJ3na9 4OYPSBYyBVsWLC7Lqczu4HaCz5f9zW7AIAdXO5LPi5WUMTnKxa7CVdeJswFu8qw1pWic V6pYXUfRkARV8tq1a/mrBrP2c95irVQ7ZamlBDtvzD4TgRZoFVG50bcI7uF9bOG9rU5S +z9Q== X-Gm-Message-State: AOAM531jqi11BHDw1MhYdV9TA6cArZbyPZBpzwxQbHBICo6VqI34BGAZ ldWDB799gdUMO0BLIDeWbGMYrZnjacS0/bdvdW4= X-Received: by 2002:ac8:6d0e:: with SMTP id o14mr20103636qtt.31.1599487394088; Mon, 07 Sep 2020 07:03:14 -0700 (PDT) Received: from [192.168.0.189] ([147.253.86.153]) by smtp.gmail.com with ESMTPSA id p29sm6299918qtu.68.2020.09.07.07.03.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Sep 2020 07:03:13 -0700 (PDT) Subject: Re: [PATCH] misc: fastrpc: add ioctl for attaching to sensors pd To: Srinivas Kandagatla , Greg Kroah-Hartman Cc: linux-arm-msm@vger.kernel.org, Arnd Bergmann , Jorge Ramirez-Ortiz , open list References: <20200901003300.11985-1-jonathan@marek.ca> <20200907123344.GA2371705@kroah.com> From: Jonathan Marek Message-ID: <4b617c4c-f0f8-3d6b-c726-9dd4bf705fbc@marek.ca> Date: Mon, 7 Sep 2020 10:02:26 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/7/20 9:58 AM, Srinivas Kandagatla wrote: > > > On 07/09/2020 14:51, Jonathan Marek wrote: >>>> @@ -1477,7 +1477,10 @@ static long fastrpc_device_ioctl(struct file >>>> *file, unsigned int cmd, >>>>           err = fastrpc_invoke(fl, argp); >>>>           break; >>>>       case FASTRPC_IOCTL_INIT_ATTACH: >>>> -        err = fastrpc_init_attach(fl); >>>> +        err = fastrpc_init_attach(fl, 0); >>>> +        break; >>>> +    case FASTRPC_IOCTL_INIT_ATTACH_SNS: >>>> +        err = fastrpc_init_attach(fl, 2); >>> >>> Shouldn't you have #defines for those magic numbers somewhere?  What >>> does 0 and 2 mean? >>> >> >> This is based off a downstream driver which also uses magic numbers, >> although I can make an educated guess about the meaning. >> >> Srini do you have any suggestions for how to name these values? > > These are domain id corresponding to each core. > you can use SDSP_DOMAIN_ID in here! > these are already defined in the file as: > > #define ADSP_DOMAIN_ID (0) > #define MDSP_DOMAIN_ID (1) > #define SDSP_DOMAIN_ID (2) > #define CDSP_DOMAIN_ID (3) > I don't think this is right: FASTRPC_IOCTL_INIT_ATTACH uses pd = 0 FASTRPC_IOCTL_INIT_CREATE uses pd = 1 And these two ioctl are used with all DSP cores. So it wouldn't make sense for the pd value to correspond to the domain id. > > --srini