Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp673158pxu; Wed, 14 Oct 2020 10:41:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWxazrZetUBynici8cjYhF35tartjIvI+ortTIVTbhhT51ts7L7HL4ItW+LsZy8OxAflMA X-Received: by 2002:a17:906:3e17:: with SMTP id k23mr170631eji.414.1602697274883; Wed, 14 Oct 2020 10:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602697274; cv=none; d=google.com; s=arc-20160816; b=SS0TYGeLMmE91S4HTINIfq524Sk5YCMbQD9xFV7XgU8ZEemA+PSfEOPVCc5eemZAq4 222PvN/aas73X7XVys6I7FOOecuUWXSxM83DdSDztbx5KwXJeTR95/OKs+kuzf0NQPiY xBgTze5PeU/mtvkPHr1DRVcpVS+rkcr5qq4CCbM0esfWEZYpyuhB19A9jVFtnUobHYJ0 LCDZgcuI7s63EZC67M4qXBUn6kVc3j78IL70HRQJLGSDxX+H9oU46Sqo8vd0XKciK7Ct 64KHHnF//s2r23auYFmi0CKJSsoP8a8oseyK4eX3l2JzTm1Oh7JhuUHt6nfRzBHm3hvr uHJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=6vlX2JaF1sElgNB9gtOmRBeCz48vpsOYcg9B7pk8ung=; b=znyAvHTmgBFH5QqIP4WWz26NhsBlyJAglLapkcAMD/4iUs5ntqvKzL1XReMWMRZ1EA g6u3kgzg/PbsgXEKUWzIe4bjMG+GPfuSu71EoeEuYK/+cILGGIQOFxxx+Q9R4vcZoq0c 3+caxL8jmD973WdWXH4Hgaq/Grg8sQTL4+XyXbyymFSSdfhu0pwZlBMpLsT95LRqtZIa IiQM+a8PN2fHRtyg843i0iuRdqZBfu50oo6YbsWQlAxVmU2cLh+vduWaHEhLvwfD0W1V q1HXv5cwXYlOeaWr/uNbwUpfLPID/pf6V9IKW3UYYWX784XeGvhP9OrXzeUand/cbw6j RjmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dwZNDaYt; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si258113ejx.608.2020.10.14.10.40.52; Wed, 14 Oct 2020 10:41:14 -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=@linutronix.de header.s=2020 header.b=dwZNDaYt; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730829AbgJNQRz (ORCPT + 99 others); Wed, 14 Oct 2020 12:17:55 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:59646 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbgJNQRy (ORCPT ); Wed, 14 Oct 2020 12:17:54 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1602692271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6vlX2JaF1sElgNB9gtOmRBeCz48vpsOYcg9B7pk8ung=; b=dwZNDaYtqbFlIeLo/Yn5Rqcmh0yEdi1FdWMJaT6EfMEHJmf3g1yR8U5x/0aLFF5XIWgYN0 TIXpvxNERp0GLsjcQ/WTXF0VdQm3oPBQydyM1gRuFv1w1SjSetq2hfI5ADYAZpQ9xr0LXt QRkfUcIueIBYmVdqF3nlcpiGTHTWBfn5lZhH87bdi84KzNwWukAVqwmFmC2U9hVpmzk46s 3Elon318GI6k+mup9gtdm0zhrQPnfLZXmcEAk0DwWNbaymmyWDTaEnf2fVtDUQf9MXRmTo 9ptDFFWbkvf6NshGrgXgaYYA8yBsze9LgYnlKuE/fsckD73VpuLa+esnXHJJfQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1602692271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6vlX2JaF1sElgNB9gtOmRBeCz48vpsOYcg9B7pk8ung=; b=Tlkepl20VtdWrbWqyNT+On+gqPKUipSXEXIZPPkpkNLVDnCvtu1PVZPN1Pf215uK2jnBXN lg8+SHLhHkPituAQ== To: Alan Stern Cc: LKML , Peter Zijlstra , Sebastian Andrzej Siewior , Johan Hovold , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Thomas Winischhofer , "Ahmed S. Darwish" , Mathias Nyman , Valentina Manea , Shuah Khan , linux-omap@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Felipe Balbi , Duncan Sands Subject: Re: [patch 03/12] USB: serial: keyspan_pda: Consolidate room query In-Reply-To: <20201014161433.GB712494@rowland.harvard.edu> References: <20201014145215.518912759@linutronix.de> <20201014145727.338773481@linutronix.de> <20201014161433.GB712494@rowland.harvard.edu> Date: Wed, 14 Oct 2020 18:17:51 +0200 Message-ID: <87ft6gbx3k.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 14 2020 at 12:14, Alan Stern wrote: > On Wed, Oct 14, 2020 at 04:52:18PM +0200, Thomas Gleixner wrote: >> From: Sebastian Andrzej Siewior >> >> Having two copies of the same code doesn't make the code more readable and >> allocating a buffer of 1 byte for a synchronous operation is a pointless >> exercise. > > Not so. In fact, it is required, because a portion of a structure > cannot be mapped for DMA unless it is aligned at a cache line boundary. > >> Add a byte buffer to struct keyspan_pda_private which can be used >> instead. The buffer is only used in open() and tty->write(). > > This won't work. Ok. >> + res = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), >> + 6, /* write_room */ >> + USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_IN, >> + 0, /* value */ >> + 0, /* index */ >> + &priv->query_buf, >> + 1, >> + 2000); > > Instead, consider using the new usb_control_msg_recv() API. But it > might be better to allocate the buffer once and for all. Let me have a look. Thanks, tglx