Received: by 10.213.65.68 with SMTP id h4csp828340imn; Wed, 14 Mar 2018 00:55:59 -0700 (PDT) X-Google-Smtp-Source: AG47ELu3QD/z6MafpBpniOFdjZ2jgwrMFSA7qBT+I2LTvFVqKw4PTDz9A80RyOYD6pkWLkpkHjc2 X-Received: by 10.99.54.74 with SMTP id d71mr2852545pga.86.1521014159071; Wed, 14 Mar 2018 00:55:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521014159; cv=none; d=google.com; s=arc-20160816; b=Uszxz5OFtiPaMDdrZ4cyAwAqWBjl3cUZc6B4GRXBtzd/wuKYpdWUp8s4QNSM26dDWt E3OiXn/43g4miSSmDvZ58hiQEpoXfNplYNecFvG9E+rlZSh9ab1jaFkkfadvjlRvCMqJ Exu5RW8cjCAf5BsRavOi37YohaP3wnpJLmjy79LjZO9I9wQtnuRPmCPkcy8GjYo599ZB 8fAxCRh67xSlsIUdb/h5c3KFQBstvWDslwJRSOgdymQVa/iogCcipa0iS1mCLOr6aQeB rMwumdA+BEkZwkwX3FGmuykHFZcDczwL3WVTbQVNto6FcXNLkxQ7ONKNb6IUJqLKnQX5 u2mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ssIpG7ENKk3Ba9Mj8uarn6+yv9/gP5HSw2IbeBOQSzg=; b=X3YeHqGVh4YxATccgksS8TgHwQ8XNJTg0un2POlW77A2lI/RBRkQ4VaxRHrADSvmfL zyX6sT2BDDIpNfbtDnPbefxpXuzHVSuWfP3h9GcX6mrLEK8yd/da4rDHa2bOBL7XXFZP cl7wphp4tGcE9p+k8y6fxAkpqYKk2qm1sYHrTIJ5Q5u2WNtuqZYmb/swbnZNZGvSs/+p WvG8lITaQKF1nWOClm59tyPcQ5IkIWZABBC8u9KI3DSj9xYbyrekOgU9vNubDyAR3LYZ ZKO4JMBDTSL6OOnOmP0w3JIJyhOan5SrxT2oFagctxrJEwHMeeEVqijbzL5uIpNxL8Vk 8S4Q== ARC-Authentication-Results: i=1; mx.google.com; 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 l6si1458727pgc.732.2018.03.14.00.55.44; Wed, 14 Mar 2018 00:55:59 -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; 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 S1753329AbeCNHxc (ORCPT + 99 others); Wed, 14 Mar 2018 03:53:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38464 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753189AbeCNHxa (ORCPT ); Wed, 14 Mar 2018 03:53:30 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 369DED30; Wed, 14 Mar 2018 07:53:29 +0000 (UTC) Date: Wed, 14 Mar 2018 07:16:12 +0100 From: Greg Kroah-Hartman To: Chunfeng Yun Cc: Matthias Brugger , Heikki Krogerus , Serge Semin , Guenter Roeck , Kate Stewart , Thomas Gleixner , Alan Stern , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH] usb: misc: supports Apple Carplay driver Message-ID: <20180314061612.GA17263@kroah.com> References: <1521007356-12306-1-git-send-email-chunfeng.yun@mediatek.com> <1521007356-12306-2-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521007356-12306-2-git-send-email-chunfeng.yun@mediatek.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 14, 2018 at 02:02:36PM +0800, Chunfeng Yun wrote: > The driver is used to support Apple carplay feature by a debugfs > interface which can force the driver to send a USB Vendor Request > of "Apple Device to Host Mode Switch" to switch Apple Device > into host mode. While I am all for crazy debugfs interfaces, I would _strongly_ suggest not doing that here for the main API to the device. I know Android is trying to prevent any new devices from even enabling debugfs, and as the file system requires root permissions by default, you are forcing any user of your new api to run as root, which is not a good idea either. Given that all you are doing here is a single usb control message, why does this even need to be a kernel driver at all? Can't you do the same thing from userspace with a simple libusb/usbfs program? Or even a simple script? thanks, greg k-h