From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763803AbdJQS5A (ORCPT ); Tue, 17 Oct 2017 14:57:00 -0400 Received: from esa6.dell-outbound.iphmx.com ([68.232.149.229]:9616 "EHLO esa6.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753271AbdJQS46 (ORCPT ); Tue, 17 Oct 2017 14:56:58 -0400 From: X-LoopCount0: from 10.166.132.187 X-IronPort-AV: E=Sophos;i="5.43,391,1503378000"; d="scan'208";a="1166234962" X-DLP: DLP_GlobalPCIDSS To: CC: , , , , , , , , , , Subject: RE: [PATCH v9 04/17] platform/x86: dell-wmi: allow 32k return size in the descriptor Thread-Topic: [PATCH v9 04/17] platform/x86: dell-wmi: allow 32k return size in the descriptor Thread-Index: AQHTR3hMQmBycKikN0m2zdGu3iYdO6LoY8Kg Date: Tue, 17 Oct 2017 18:56:52 +0000 Message-ID: References: <68ba1b833a86f80b89eedfda8417ca0cc774d321.1508259916.git.mario.limonciello@dell.com> <20171017184643.pfsiracfb5pfz2ym@pali> In-Reply-To: <20171017184643.pfsiracfb5pfz2ym@pali> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.143.18.86] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v9HIv5Ll013317 > -----Original Message----- > From: Pali Rohár [mailto:pali.rohar@gmail.com] > Sent: Tuesday, October 17, 2017 1:47 PM > To: Limonciello, Mario > Cc: dvhart@infradead.org; Andy Shevchenko ; > LKML ; platform-driver-x86@vger.kernel.org; Andy > Lutomirski ; quasisec@google.com; rjw@rjwysocki.net; > mjg59@google.com; hch@lst.de; Greg KH ; Alan Cox > > Subject: Re: [PATCH v9 04/17] platform/x86: dell-wmi: allow 32k return size in the > descriptor > > On Tuesday 17 October 2017 13:21:48 Mario Limonciello wrote: > > Some platforms this year will be adopting 32k WMI buffer, so don't > > complain when encountering those. > > > > Signed-off-by: Mario Limonciello > > Reviewed-by: Edward O'Callaghan > > --- > > drivers/platform/x86/dell-wmi.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c > > index ece2fe341f01..2578dff90a14 100644 > > --- a/drivers/platform/x86/dell-wmi.c > > +++ b/drivers/platform/x86/dell-wmi.c > > @@ -624,7 +624,7 @@ static void dell_wmi_input_destroy(struct wmi_device > *wdev) > > * Vendor Signature 0 4 "DELL" > > * Object Signature 4 4 " WMI" > > * WMI Interface Version 8 4 > > - * WMI buffer length 12 4 4096 > > + * WMI buffer length 12 4 4096 or 32768 > > */ > > static int dell_wmi_check_descriptor_buffer(struct wmi_device *wdev) > > { > > @@ -674,7 +674,7 @@ static int dell_wmi_check_descriptor_buffer(struct > wmi_device *wdev) > > dev_warn(&wdev->dev, "Dell descriptor buffer has unknown > version (%u)\n", > > buffer[2]); > > > > - if (buffer[3] != 4096) > > + if (buffer[3] != 4096 && buffer[3] != 32768) > > dev_warn(&wdev->dev, "Dell descriptor buffer has invalid buffer > length (%u)\n", > > buffer[3]); > > > > Now, when buffer size is going to be exported to userspace and userspace > would need to prepare correct request, would not it better to allow any > positive buffer size? This would allow new machines to work even if > buffer size would be increased again (or decreased). I suppose you're right the warning isn't very useful as the data is properly used within userspace and the rest of the drivers now. I'll make some adjustments to remove this warning instead.