Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1663863pxb; Tue, 26 Oct 2021 13:20:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/8twZDMktIBST894AG6ZynW/ZGbvmusBkbhrNILYVSxEw7POpVyZm6jxBsR/QaTNhm7lk X-Received: by 2002:a17:902:9887:b0:13f:7704:425f with SMTP id s7-20020a170902988700b0013f7704425fmr24265114plp.20.1635279617000; Tue, 26 Oct 2021 13:20:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635279616; cv=none; d=google.com; s=arc-20160816; b=RiINNuRK+TXCBN+SdUKO21JYWdnZEeTyT+79qr7dEVMVlpX7LstP6VmcgZG6Kthy0G HbfE8D4Icdo9okPEOInEW9gVOQ49UFiW0Th43QQw+0zdYmgDmfxYqRmtnzL8CmwUVg3w zPQo3lQqNTyMUNPL6pKgEBFFAgohQ9DSZqLObvoTcvqfYFAOdEW/HPqgxRuhFzR4QZmf p21TWjivTFsXpMm17UEUYHTdvjn6tOZwfeX71+2DBTwDufmlbI1DPsWitfPRcDQflB+P qioI7blpuU9CVUvsBYyiH7Bw5XqQGKh0Wd+hDLtpAJc6GjB5u4UtzyRB8YFD7TNpCxpA /tRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6IOVJf47FRYek2TM+QPeRC6JkXb+1liGG1wPdoRw8us=; b=b6RBwFfI0YFN3bd9jyhaSzH/xHWnQ3Tsw1AGB0wEotoJUDkREMUUvZOQTTOBS0Qx4P 2mM6etvhNFVV3bjSPJLc5GsXiipS5ngx6vdkXCte/w42/jlMOReoHUkvZNAz1IoLzl5r axBfe3NpFgQMGcY5WLVTQflvjpRNuuXtkJCYEEco+PPAUJXYp60tNluC0gKhbR362hFI Wke9Nr3rhcIyCTQnmen1fTxHFyC/LZDKRI5edEKSOxVNhpSsY8c9au8YrJ8bJgYoibfE qBw3HAkJYZE7PhjgnH3ASdBzg6EQQjCiIoLdvv6SL020udWRaDbE3lpoFXhY/lKx6G99 F/Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LzjRGliV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pg4si2456686pjb.168.2021.10.26.13.20.01; Tue, 26 Oct 2021 13:20:16 -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=@linuxfoundation.org header.s=korg header.b=LzjRGliV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235605AbhJZPK1 (ORCPT + 99 others); Tue, 26 Oct 2021 11:10:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:35426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231545AbhJZPK1 (ORCPT ); Tue, 26 Oct 2021 11:10:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D60D760200; Tue, 26 Oct 2021 15:08:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635260883; bh=0XC+Ubh1QkWoRD6gJg2T3EnMFPxdPJ1VDdiOnTzCcT4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LzjRGliV/g/PF5CswOAGe1WCK7HafenLr5+7zV3gP4PZ1kvxGpnXlPCsWqiJnSUY7 2HBi2KSB1g9Fn6TLAo20n7SgTr/HO9qFEtTbvB0Gw49abqqyjqYPRSp0X/cisf6u1t OYya2vaOB9JB4liNCVFpn4Cn5Wp3huyLuiIx4d5Q= Date: Tue, 26 Oct 2021 17:08:00 +0200 From: Greg KH To: Heikki Krogerus Cc: Prashant Malani , Benson Leung , Adam Thomson , Guenter Roeck , Badhri Jagan Sridharan , Jack Pham , "Gopal, Saranya" , "Regupathy, Rajaram" , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 2/4] usb: typec: Character device for USB Power Delivery devices Message-ID: References: <20211026143352.78387-1-heikki.krogerus@linux.intel.com> <20211026143352.78387-3-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211026143352.78387-3-heikki.krogerus@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2021 at 05:33:50PM +0300, Heikki Krogerus wrote: > Interim. > > TODO/ideas: > - Figure out a proper magic value for the ioctl and check if > the ioctl range is OK. > - Register separate PD device for the cdev, and register it > only if the device (port, plug or partner) actually > supports USB PD (or come up with some other solution?). > - Introduce something like > > struct pd_request { > struct pd_message request; > struct pd_message __user *response; > }; > > and use it instead of only single struct pd_messages everywhere. > > - Add compat support. Ick, no, new ioctls should never need compat support if you create them properly. That is only for "old" ones. Also, why not use the miscdev api instead? That should remove some code of yours and make things simpler, if you really want to stick with a char device node... thanks, greg k-h