Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp570731ybk; Wed, 20 May 2020 06:50:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQGT//S4gxKeYjqcJuRe2//HFptgop0lm2j3BIIjtyunlG4L+SjImm98bzCe6/NOnRV3iU X-Received: by 2002:a05:6402:3128:: with SMTP id dd8mr3587407edb.156.1589982649187; Wed, 20 May 2020 06:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589982649; cv=none; d=google.com; s=arc-20160816; b=lIqskRkunsq8jlvOuVpxkjl6tXgHFOWvetmdTOoIj4LtFU02kwy2H1+0Ixtyf6fEUE HzWd48PDnD813OPFte7bENvcn3ZxhRcUVjQRrcUYxsICNLqiwGxrIPSSE+CuxjND1ylf xstICCvkNVy2rj9CT241mxdrvxerqL/xP64dttWKcLeL3j6nJp4ouOJFhbDxbUyFsuP2 +rqzLPHmyrtOIP3abgmoqvAkjNP9hMex/0kn8E9kQtemQcjUjkfQVVXasjWfg03su0SD mU+dHISjO0mYWLKUm8Ny+gkmxo2Zas4HVgXU2PADZzOM0ZRifuVlsiwweyufApFbnOEc PmPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=xvsOAfOqrhqGUhi15Khol6XctQMOgwH3mpfkrmBge34=; b=eUfB37sTJggbdqTtLvvDVFGPjxO4A+dqaGM0+bjJG3UGvhLhlmo9IgtRs4i+1C5htc ujY4z2Fs15vdNyKrpbetamDdOAEfzUdZzZly5dOe4gpyn33OymRTe1SHIdTeqMx2HwVa MDDPHQFosIB8csyENJRz9LT+g0qrU/Upv2SIQexzxzjHGa9vsg6W8bW+uCtfu9/Vyxnm 79KVb0fjKNINCN5iWd1G4Jczc8YaIqY4RmuZRQdAznTjIKUd7y+mTdXIhRSbCTBwPw+a EGLpIVOvzBVKKVIhSldSkZ9YzHMHXF9h0F+Mwf3KUU2Zg7jBWgJjTtAoyduHwSviKrP4 CAig== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si1816071edn.487.2020.05.20.06.50.25; Wed, 20 May 2020 06:50:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726838AbgETNsd (ORCPT + 99 others); Wed, 20 May 2020 09:48:33 -0400 Received: from mail.baikalelectronics.com ([87.245.175.226]:59090 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbgETNsc (ORCPT ); Wed, 20 May 2020 09:48:32 -0400 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id BE2DE8030875; Wed, 20 May 2020 13:48:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 879XwsdEpqBa; Wed, 20 May 2020 16:48:28 +0300 (MSK) Date: Wed, 20 May 2020 16:48:26 +0300 From: Serge Semin To: Thomas Bogendoerfer CC: Serge Semin , Alexey Malahov , Paul Burton , Ralf Baechle , Greg Kroah-Hartman , Arnd Bergmann , Rob Herring , , , Vincenzo Frascino , Thomas Gleixner , , Subject: Re: [PATCH v2 18/20] mips: csrc-r4k: Decrease r4k-clocksource rating if CPU_FREQ enabled Message-ID: <20200520134826.pc6si3k6boaexp4i@mobilestation> References: <20200508154150.GB22247@alpha.franken.de> <20200511133121.cz5axbwynhmqkx7x@mobilestation> <20200515074827.6p5zx4sb3bmavjih@mobilestation> <20200515210647.GA22922@alpha.franken.de> <20200518134820.wedoumgbsllvhem6@mobilestation> <20200518163206.GA17800@alpha.franken.de> <20200518205752.txbylbjt2zkwdwwe@mobilestation> <20200519155053.GB15797@alpha.franken.de> <20200520121201.wohv6u646rx5otkf@mobilestation> <20200520133827.GA17714@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200520133827.GA17714@alpha.franken.de> X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 20, 2020 at 03:38:27PM +0200, Thomas Bogendoerfer wrote: > On Wed, May 20, 2020 at 03:12:01PM +0300, Serge Semin wrote: > > Since you don't like the way I initially fixed it, suppose there we don't have > > another way but to introduce something like CONFIG_MIPS_CPS_NS16550_WIDTH > > parameter to select a proper accessors, like sw in our case, and sb by defaul). > > Right? > > to be on the safe side it's probably the best thing. But I don't know > enough about CPS_NS16550 to judge whether shift value correlates with > possible access width. The base address passed to the _mips_cps_putc() leaf is UART-base address. It has nothing to do with CPS. See: /** * _mips_cps_putc() - write a character to the UART * @a0: ASCII character to write * @t9: UART base address */ LEAF(_mips_cps_putc) 1: lw t0, UART_LSR_OFS(t9) andi t0, t0, UART_LSR_TEMT beqz t0, 1b sb a0, UART_TX_OFS(t9) jr ra END(_mips_cps_putc) So it's base address must be accessed with proper alignment. On our case it's lw/sw instructions. Regarding using lw in the first line of the function. That's must be a bug, since further in the same function they use sb to access the UART Tx register. So reading a data from UART_LSR register should be also byte-sized by using lb. -Sergey > > Thomas. > > -- > Crap can work. Given enough thrust pigs will fly, but it's not necessarily a > good idea. [ RFC1925, 2.3 ]