Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp673883pxu; Wed, 14 Oct 2020 10:42:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDoGpVWJvt+tg2vKO2e8WUdJXt3+RM+zm+p350b0Ony2nKkWr4BXZf9x5L9WENfkNO80TH X-Received: by 2002:aa7:d449:: with SMTP id q9mr6406630edr.321.1602697333806; Wed, 14 Oct 2020 10:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602697333; cv=none; d=google.com; s=arc-20160816; b=Ybx6GJDDtHUjhueyOnb6HmcCpqDpmuqDS7N3s6ZOUAT00Vz9NfgbdAUImNB35GdXq2 XyTs6tLvPzeqn4NC8LsVci/fvl+2Ik7LN6qcxA9J0jeALzx9i12Mco7pt/7POOCOFWDU ZaqLgE32GyUaCOjBz9vbI8G5caZ3V54AoNN1SwtVamavdXGLn5KZMPIFCf21YK8Xoi4T zuMeO7a2XJWlPEXfP6Qy3KBbdc79bNezAV6Qs7Xt00OW9Cv+lMPVyrIBnJzNBpNxXjq3 tB2zzp/FpyYYmC1QHwJI5Hzl5NohfoocBxwRPvl1Dc97eAWN2jneXW+l57kMe6VgY7IV 5w1A== 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:dkim-signature :dkim-signature:date; bh=zAjTF2tvsD0V9R0iboON9J/WHaKQyttRthc3o5MCNUM=; b=feOcGso5GyPkNHUV5Mk7DnyWyJp8cyNOus06PRr1rvuh0LHd7nsO3rsNRX/GAKXyuG IEl1ZOlp1onb0g1yTqyhAmel3eEfOrFAIKT+LpECOztwI1c2LExW6CymUWdlJv2RsUg9 oSrd6JgWyqwragtVe0xRDl6pvjL5uD8XYQcSExDwEbJoy/TIdoYotNlfGcxPNY4SVBbw tOISyRbDgZL0bCLNzieeSi+k5Y1wEf2xOGOw+TnpuTq4vQzbgcaTzXtfEiS3CsAv1ki9 B30FRpikrnNGBaFkdL7uOddRAvEi9ehKJQyVmDvTXfLwHoJWCeodv9/N64Gvo69wkghh UOQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="NIoUc/R+"; dkim=neutral (no key) header.i=@linutronix.de header.b=gcXKnbuq; 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 o26si257745ejh.287.2020.10.14.10.41.51; Wed, 14 Oct 2020 10:42:13 -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="NIoUc/R+"; dkim=neutral (no key) header.i=@linutronix.de header.b=gcXKnbuq; 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 S1731944AbgJNQor (ORCPT + 99 others); Wed, 14 Oct 2020 12:44:47 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:59924 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727559AbgJNQor (ORCPT ); Wed, 14 Oct 2020 12:44:47 -0400 Date: Wed, 14 Oct 2020 18:44:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1602693885; 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=zAjTF2tvsD0V9R0iboON9J/WHaKQyttRthc3o5MCNUM=; b=NIoUc/R+XCVqOSwu2oDnlmcFuWxwi0qBJR10Ewtfv8G4TtgfP8C39TvFwo51kSOInNdMzP KwSQDMQLFLu4dI8IWdVbGSnhMxqtirL/r7Erh/kj3V3V+ThAPHQBb9ZxlFjLifxlxW+XTv U98DppwGDyHnqtqPnW/d7lxfWuuBqmVLH9pHKUXUd/31AjbdyB3uobhw2EBJGbpTUvw/oO P9Gsq6MixUwHewHE82UCkO16XGixQTABWWxS4Cz8BKGEopVsywJ8Z2dvhptFac8h7p/7bf ZFDNScC8xX4I3O9L1ipViKHMheIsbKTqajZWzO4V+W6daFjTIvFqPaVAFEwsdw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1602693885; 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=zAjTF2tvsD0V9R0iboON9J/WHaKQyttRthc3o5MCNUM=; b=gcXKnbuqKZQ4iJNiXtOhVGCmWuPiMl04f5Bgy+IfD5qIYdOK5klQFW+0bC6IE+MdVjmTOf u6e56ZwwSwgVkfBw== From: Sebastian Andrzej Siewior To: Alan Stern Cc: Thomas Gleixner , LKML , Peter Zijlstra , 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 Message-ID: <20201014164443.husmibyqb4ukw5xg@linutronix.de> References: <20201014145215.518912759@linutronix.de> <20201014145727.338773481@linutronix.de> <20201014161433.GB712494@rowland.harvard.edu> <20201014162714.ctv5earlhwsp4iqs@linutronix.de> <20201014163425.GF712494@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201014163425.GF712494@rowland.harvard.edu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-10-14 12:34:25 [-0400], Alan Stern wrote: > On Wed, Oct 14, 2020 at 06:27:14PM +0200, Sebastian Andrzej Siewior wrote: > > On 2020-10-14 12:14:33 [-0400], Alan Stern wrote: > > > Instead, consider using the new usb_control_msg_recv() API. But it > > > might be better to allocate the buffer once and for all. > > > > This will still allocate and free buffer on each invocation. What about > > Yes. That's why I suggesting doing a single buffer allocation at the > start and using it for each I/O transfer. (But I'm not familiar with > this code, and I don't know if there might be multiple transfers going > on concurrently.) There are no concurrent transfer. There is a bit used as a lock. The first one does the transfer, the other wait. > > moving the query_buf to the begin of the struct / align it? > > No, thank won't work either. The key to the issue is that while some > memory is mapped for DMA, the CPU must not touch it or anything else in > the same cache line. If a field is a member of a data structure, the > CPU might very well access a neighboring member while this one is > mapped, thereby messing up the cache line. that is unfortunately true. Let me do the single buffer. > Alan Stern Sebastian