Re: [PATCH trivial] KVM: PPC: Remove superfluous check for non-zero return value

2019-09-18 Thread Thomas Huth
On 18/09/2019 22.54, Greg Kurz wrote: > On Wed, 18 Sep 2019 18:44:36 +0200 > Greg Kurz wrote: > >> On Wed, 11 Sep 2019 21:52:35 +0200 >> Thomas Huth wrote: >> >>> After the kfree()s haven been removed in the previous >>> commit 9798f4ea71ea ("fix rollback when kvmppc_xive_create fails"), >>> the

Re: [PATCH] mm/pgtable/debug: Fix test validating architecture page table helpers

2019-09-18 Thread Christophe Leroy
Le 18/09/2019 à 09:32, Anshuman Khandual a écrit : On 09/13/2019 11:53 AM, Christophe Leroy wrote: Fix build failure on powerpc. Fix preemption imbalance. Signed-off-by: Christophe Leroy --- mm/arch_pgtable_test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/arch_pgtable_

Re: [PATCH V2 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-18 Thread Christophe Leroy
Le 19/09/2019 à 06:56, Anshuman Khandual a écrit : On 09/18/2019 09:56 PM, Christophe Leroy wrote: Le 18/09/2019 à 07:04, Anshuman Khandual a écrit : On 09/13/2019 03:31 PM, Christophe Leroy wrote: Le 13/09/2019 à 11:02, Anshuman Khandual a écrit : +#if !defined(__PAGETABLE_PMD_F

Re: [PATCH v3 2/2] powerpc/irq: inline call_do_irq() and call_do_softirq()

2019-09-18 Thread Christophe Leroy
Le 18/09/2019 à 18:39, Segher Boessenkool a écrit : Hi Christophe, On Wed, Sep 18, 2019 at 03:48:20PM +, Christophe Leroy wrote: call_do_irq() and call_do_softirq() are quite similar on PPC32 and PPC64 and are simple enough to be worth inlining. Inlining them avoids an mflr/mtlr pair pl

Re: [PATCH V2 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-18 Thread Anshuman Khandual
On 09/18/2019 09:56 PM, Christophe Leroy wrote: > > > Le 18/09/2019 à 07:04, Anshuman Khandual a écrit : >> >> >> On 09/13/2019 03:31 PM, Christophe Leroy wrote: >>> >>> >>> Le 13/09/2019 à 11:02, Anshuman Khandual a écrit : >> +#if !defined(__PAGETABLE_PMD_FOLDED) && !defined(__ARCH_

Re: [PATCH 3/5] ocxl: Tally up the LPC memory on a link & allow it to be mapped

2019-09-18 Thread Alastair D'Silva
On Wed, 2019-09-18 at 16:02 +0200, Frederic Barrat wrote: > > Le 17/09/2019 à 03:42, Alastair D'Silva a écrit : > > From: Alastair D'Silva > > > > Tally up the LPC memory on an OpenCAPI link & allow it to be mapped > > > > Signed-off-by: Alastair D'Silva > > --- > > drivers/misc/ocxl/core.c

Re: [PATCH v3 1/5] powerpc: Allow flush_icache_range to work across ranges >4GB

2019-09-18 Thread Alastair D'Silva
On Thu, 2019-09-19 at 13:43 +1000, Michael Ellerman wrote: > "Alastair D'Silva" writes: > > From: Alastair D'Silva > > > > When calling flush_icache_range with a size >4GB, we were masking > > off the upper 32 bits, so we would incorrectly flush a range > > smaller > > than intended. > > > > __

Re: [PATCH v3 1/5] powerpc: Allow flush_icache_range to work across ranges >4GB

2019-09-18 Thread Michael Ellerman
"Alastair D'Silva" writes: > From: Alastair D'Silva > > When calling flush_icache_range with a size >4GB, we were masking > off the upper 32 bits, so we would incorrectly flush a range smaller > than intended. > > __kernel_sync_dicache in the 64 bit VDSO has the same bug. Please fix that in a se

RE: [PATCH V2 3/4] ASoC: pcm_dmaengine: Extract snd_dmaengine_pcm_set_runtime_hwparams

2019-09-18 Thread S.j. Wang
Hi > > When set the runtime hardware parameters, we may need to query the > capability of DMA to complete the parameters. > > This patch is to Extract this operation from > dmaengine_pcm_set_runtime_hwparams function to a separate function > snd_dmaengine_pcm_set_runtime_hwparams, that other com

Re: [PATCH 4/5] ocxl: Add functions to map/unmap LPC memory

2019-09-18 Thread Alastair D'Silva
On Tue, 2019-09-17 at 11:43 +1000, Alastair D'Silva wrote: > From: Alastair D'Silva > > Add functions to map/unmap LPC memory > > Signed-off-by: Alastair D'Silva > --- > drivers/misc/ocxl/config.c| 4 +++ > drivers/misc/ocxl/core.c | 50 > +++ > dr

Re: [PATCH 4/5] ocxl: Add functions to map/unmap LPC memory

2019-09-18 Thread Alastair D'Silva
On Wed, 2019-09-18 at 16:03 +0200, Frederic Barrat wrote: > > Le 17/09/2019 à 03:43, Alastair D'Silva a écrit : > > From: Alastair D'Silva > > > > Add functions to map/unmap LPC memory > > > > Signed-off-by: Alastair D'Silva > > --- > > drivers/misc/ocxl/config.c| 4 +++ > > driver

Re: [PATCH 2/5] powerpc: Map & release OpenCAPI LPC memory

2019-09-18 Thread Alastair D'Silva
On Wed, 2019-09-18 at 16:03 +0200, Frederic Barrat wrote: > > Le 17/09/2019 à 03:42, Alastair D'Silva a écrit : > > From: Alastair D'Silva > > > > Map & release OpenCAPI LPC memory. > > > > Signed-off-by: Alastair D'Silva > > --- > > arch/powerpc/include/asm/pnv-ocxl.h | 2 ++ > > arch/p

Re: [PATCH v2 1/3] tools/perf: Move kvm-stat header file from conditional inclusion to common include section

2019-09-18 Thread Arnaldo Carvalho de Melo
Em Fri, Jul 19, 2019 at 10:58:37AM +0530, Ravi Bangoria escreveu: > > LGTM. For the series, > > Reviewed-By: Ravi Bangoria Thanks, applied. - Arnaldo

Re: [PATCH v3 2/2] net/ibmvnic: prevent more than one thread from running in reset

2019-09-18 Thread Juliet Kim
On 9/18/19 1:12 AM, Michael Ellerman wrote: > Hi Juliet, > > Juliet Kim writes: >> Signed-off-by: Juliet Kim >> --- >> drivers/net/ethernet/ibm/ibmvnic.c | 23 ++- >> drivers/net/ethernet/ibm/ibmvnic.h | 3 +++ >> 2 files changed, 25 insertions(+), 1 deletion(-) >> >> diff

Re: [PATCH trivial] KVM: PPC: Remove superfluous check for non-zero return value

2019-09-18 Thread Greg Kurz
On Wed, 11 Sep 2019 21:52:35 +0200 Thomas Huth wrote: > After the kfree()s haven been removed in the previous > commit 9798f4ea71ea ("fix rollback when kvmppc_xive_create fails"), > the code can be simplified even more to simply always "return ret" > now. > > Signed-off-by: Thomas Huth > --- T

Re: [PATCH trivial] KVM: PPC: Remove superfluous check for non-zero return value

2019-09-18 Thread Greg Kurz
On Wed, 18 Sep 2019 18:44:36 +0200 Greg Kurz wrote: > On Wed, 11 Sep 2019 21:52:35 +0200 > Thomas Huth wrote: > > > After the kfree()s haven been removed in the previous > > commit 9798f4ea71ea ("fix rollback when kvmppc_xive_create fails"), > > the code can be simplified even more to simply al

Re: [PATCH 2/2] MIPS: remove support for DMA_ATTR_WRITE_COMBINE

2019-09-18 Thread Maciej W. Rozycki
On Wed, 7 Aug 2019, Christoph Hellwig wrote: > Mips uses the KSEG1 kernel memory segment to map dma coherent > allocations for non-coherent devices as uncacheable, and does not have > any kind of special support for DMA_ATTR_WRITE_COMBINE in the allocation > path. Thus supporting DMA_ATTR_WRITE_C

Re: [PATCH V2 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-18 Thread Gerald Schaefer
On Wed, 18 Sep 2019 18:26:03 +0200 Christophe Leroy wrote: [..] > My suggestion was not to completely drop the #ifdef but to do like you > did in pgd_clear_tests() for instance, ie to add the following test on > top of the function: > > if (mm_pud_folded(mm) || is_defined(__ARCH_HAS_5LE

Re: [PATCH 0/2] pseries/hotplug: Change the default behaviour of cede_offline

2019-09-18 Thread Naveen N. Rao
Michael Ellerman wrote: "Naveen N. Rao" writes: Michael Ellerman wrote: "Gautham R. Shenoy" writes: From: "Gautham R. Shenoy" Currently on Pseries Linux Guests, the offlined CPU can be put to one of the following two states: - Long term processor cede (also called extended cede) - Re

Re: [PATCH 0/2] pseries/hotplug: Change the default behaviour of cede_offline

2019-09-18 Thread Nathan Lynch
Gautham R Shenoy writes: > The accounting problem in tools such as lparstat with > "cede_offline=on" is affecting customers who are using these tools for > capacity-planning. That problem needs a fix in the short-term, for > which Patch 1 changes the default behaviour of cede_offline from "on" > t

Re: [PATCH v3 2/2] powerpc/irq: inline call_do_irq() and call_do_softirq()

2019-09-18 Thread Segher Boessenkool
Hi Christophe, On Wed, Sep 18, 2019 at 03:48:20PM +, Christophe Leroy wrote: > call_do_irq() and call_do_softirq() are quite similar on PPC32 and > PPC64 and are simple enough to be worth inlining. > > Inlining them avoids an mflr/mtlr pair plus a save/reload on stack. But you hardcode the c

Re: [PATCH V2 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-18 Thread Christophe Leroy
Le 18/09/2019 à 07:04, Anshuman Khandual a écrit : On 09/13/2019 03:31 PM, Christophe Leroy wrote: Le 13/09/2019 à 11:02, Anshuman Khandual a écrit : +#if !defined(__PAGETABLE_PMD_FOLDED) && !defined(__ARCH_HAS_4LEVEL_HACK) #ifdefs have to be avoided as much as possible, see below

Re: [PATCH V2 3/4] ASoC: pcm_dmaengine: Extract snd_dmaengine_pcm_set_runtime_hwparams

2019-09-18 Thread kbuild test robot
/Shengjiu-Wang/ASoC-fsl_asrc-Use-in-out-put_format-instead-of-in-out-put_word_width/20190918-145058 config: arm-viper_defconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin

[PATCH v3 2/2] powerpc/irq: inline call_do_irq() and call_do_softirq()

2019-09-18 Thread Christophe Leroy
call_do_irq() and call_do_softirq() are quite similar on PPC32 and PPC64 and are simple enough to be worth inlining. Inlining them avoids an mflr/mtlr pair plus a save/reload on stack. This is inspired from S390 arch. Several other arches do more or less the same. The way sparc arch does seems od

[PATCH v3 1/2] powerpc/irq: bring back ksp_limit management in C functions.

2019-09-18 Thread Christophe Leroy
Commit cbc9565ee826 ("powerpc: Remove ksp_limit on ppc64") moved PPC32 ksp_limit handling in assembly functions call_do_softirq() and call_do_irq() as they are different for PPC32 and PPC64. In preparation of replacing these functions by inline assembly, partialy revert that commit to bring back k

Re: [PATCH v12 05/12] namei: obey trailing magic-link DAC permissions

2019-09-18 Thread Aleksa Sarai
On 2019-09-18, Aleksa Sarai wrote: > On 2019-09-17, Jann Horn wrote: > > On Wed, Sep 4, 2019 at 10:21 PM Aleksa Sarai wrote: > > > The ability for userspace to "re-open" file descriptors through > > > /proc/self/fd has been a very useful tool for all sorts of usecases > > > (container runtimes a

Re: [PATCH v4] powerpc/setup_64: fix -Wempty-body warnings

2019-09-18 Thread Qian Cai
Michael, ping in case that you might forget this one forever as well. On Mon, 2019-07-15 at 14:32 -0400, Qian Cai wrote: > At the beginning of setup_64.c, it has, > > #ifdef DEBUG > #define DBG(fmt...) udbg_printf(fmt) > #else > #define DBG(fmt...) > #endif > > where DBG() could be com

Re: [Bug 204789] New: Boot failure with more than 256G of memory

2019-09-18 Thread Cameron Berkenpas
Hello, Unfortunately, this patch set has made things quite a bit worse for me. Appending mem=256G doesn't fix it either. in all cases, the system at least gets past early boot and then I will probably get a panic and eventual reboot, or occasionally it just locks up entirely. Here's my very

[RFC PATCH] powerpc/mm/mce: Keep irq disabled during lockless page table walk

2019-09-18 Thread Aneesh Kumar K.V
__find_linux_mm_pte return a page table entry pointer walking the page table without holding locks. To make it safe against a THP split and collapse, we disable interrupts around the lockless page table walk. We need to keep the interrupts disabled as long as we use the page table entry pointer. C

Re: [PATCH] powerpc: Add barrier_nospec to raw_copy_in_user()

2019-09-18 Thread Michael Ellerman
Michal Suchánek writes: > On Wed, 6 Mar 2019 12:10:38 +1100 > Suraj Jitindar Singh wrote: > >> Commit ddf35cf3764b ("powerpc: Use barrier_nospec in copy_from_user()") >> Added barrier_nospec before loading from user-controller pointers. >> The intention was to order the load from the potentially

Re: [PATCH 4/5] ocxl: Add functions to map/unmap LPC memory

2019-09-18 Thread Frederic Barrat
Le 17/09/2019 à 03:43, Alastair D'Silva a écrit : From: Alastair D'Silva Add functions to map/unmap LPC memory Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/config.c| 4 +++ drivers/misc/ocxl/core.c | 50 +++ drivers/misc/ocxl/link.

Re: [PATCH 2/5] powerpc: Map & release OpenCAPI LPC memory

2019-09-18 Thread Frederic Barrat
Le 17/09/2019 à 03:42, Alastair D'Silva a écrit : From: Alastair D'Silva Map & release OpenCAPI LPC memory. Signed-off-by: Alastair D'Silva --- arch/powerpc/include/asm/pnv-ocxl.h | 2 ++ arch/powerpc/platforms/powernv/ocxl.c | 42 +++ 2 files changed, 44 ins

Re: [PATCH 3/5] ocxl: Tally up the LPC memory on a link & allow it to be mapped

2019-09-18 Thread Frederic Barrat
Le 17/09/2019 à 03:42, Alastair D'Silva a écrit : From: Alastair D'Silva Tally up the LPC memory on an OpenCAPI link & allow it to be mapped Signed-off-by: Alastair D'Silva --- drivers/misc/ocxl/core.c | 9 + drivers/misc/ocxl/link.c | 61 +

[PATCH] powerpc/book3s64/radix: Avoid WARN_ON in destroy_context

2019-09-18 Thread Aneesh Kumar K.V
On failed task initialization due to memory allocation failures, we can call into destroy_context with process_tb entry set. This patch forces the process_tb entry to zero in destroy_context. With this patch, we lose the ability to track if we are destroying a context without flushing the process t

Re: [PATCH v12 05/12] namei: obey trailing magic-link DAC permissions

2019-09-18 Thread Aleksa Sarai
On 2019-09-17, Jann Horn wrote: > On Wed, Sep 4, 2019 at 10:21 PM Aleksa Sarai wrote: > > The ability for userspace to "re-open" file descriptors through > > /proc/self/fd has been a very useful tool for all sorts of usecases > > (container runtimes are one common example). However, the current >

Re: [PATCH v2 2/2] powerpc/mm: call H_BLOCK_REMOVE when supported

2019-09-18 Thread Michael Ellerman
Hi Laurent, Few comments ... Laurent Dufour writes: > Now we do not call _BLOCK_REMOVE all the time when the feature is > exhibited. This isn't true until after the patch is applied, ie. the tense is wrong. The rest of the change log explains things fine, so just drop that sentence I think. Ca

Re: [PATCH v2 1/2] powperc/mm: read TLB Block Invalidate Characteristics

2019-09-18 Thread Michael Ellerman
Hi Laurent, Comments below ... Laurent Dufour writes: > The PAPR document specifies the TLB Block Invalidate Characteristics which > tells for each couple segment base page size, actual page size, the size of ^ "pair of" again > the block the hcall H_BLOCK_REMO

Re: [PATCH v2 0/2] powerpc/mm: Conditionally call H_BLOCK_REMOVE

2019-09-18 Thread Michael Ellerman
Hi Laurent, Thanks for fixing this, just a few comments. Laurent Dufour writes: > Since the commit ba2dd8a26baa ("powerpc/pseries/mm: call H_BLOCK_REMOVE"), > the call to H_BLOCK_REMOVE is always done if the feature is exhibited. > > However, the hypervisor may not support all the block size for

Re: [PATCH v1 0/4] powerpc: Add support for GENERIC_EARLY_IOREMAP

2019-09-18 Thread Christoph Hellwig
On Thu, Sep 12, 2019 at 01:49:40PM +, Christophe Leroy wrote: > This series adds support for GENERIC_EARLY_IOREMAP on powerpc. > > It also adds a warning in the standard ioremap() when it's called > before vmalloc is available in order to help locate those users. > > Next step will be to incr

Re: [PATCH 0/2] pseries/hotplug: Change the default behaviour of cede_offline

2019-09-18 Thread Aneesh Kumar K.V
On 9/18/19 5:01 PM, Michael Ellerman wrote: "Naveen N. Rao" writes: Michael Ellerman wrote: "Gautham R. Shenoy" writes: From: "Gautham R. Shenoy" Also, since we expose [S]PURR through sysfs, any tools that make use of that directly are also affected due to this. But again if we

Re: [PATCH 0/2] pseries/hotplug: Change the default behaviour of cede_offline

2019-09-18 Thread Gautham R Shenoy
On Wed, Sep 18, 2019 at 03:14:15PM +1000, Michael Ellerman wrote: > "Gautham R. Shenoy" writes: > > From: "Gautham R. Shenoy" > > > > Currently on Pseries Linux Guests, the offlined CPU can be put to one > > of the following two states: > >- Long term processor cede (also called extended cede

Re: [PATCH 0/2] pseries/hotplug: Change the default behaviour of cede_offline

2019-09-18 Thread Gautham R Shenoy
Hello Nathan, Michael, On Tue, Sep 17, 2019 at 12:36:35PM -0500, Nathan Lynch wrote: > Gautham R Shenoy writes: > > On Thu, Sep 12, 2019 at 10:39:45AM -0500, Nathan Lynch wrote: > >> "Gautham R. Shenoy" writes: > >> > The patchset also defines a new sysfs attribute > >> > "/sys/device/system/cpu

Re: [PATCH 0/2] pseries/hotplug: Change the default behaviour of cede_offline

2019-09-18 Thread Michael Ellerman
"Naveen N. Rao" writes: > Michael Ellerman wrote: >> "Gautham R. Shenoy" writes: >>> From: "Gautham R. Shenoy" >>> >>> Currently on Pseries Linux Guests, the offlined CPU can be put to one >>> of the following two states: >>>- Long term processor cede (also called extended cede) >>>- Ret

Re: [PATCH] powerpc/crashkernel: take mem option into account

2019-09-18 Thread Michael Ellerman
Pingfan Liu writes: > Cc Kexec list. And keep the original content. > > On Thu, Sep 12, 2019 at 10:50 AM Pingfan Liu wrote: >> >> 'mem=" option is an easy way to put high pressure on memory during some >> test. Hence in stead of total mem, the effective usable memory size ^

Re: [PATCH v8 2/8] kvmppc: Movement of pages between normal and secure memory

2019-09-18 Thread Bharata B Rao
On Wed, Sep 18, 2019 at 12:42:10PM +0530, Bharata B Rao wrote: > On Tue, Sep 17, 2019 at 04:31:39PM -0700, Sukadev Bhattiprolu wrote: > > > > Minor: Can this allocation be outside the lock? I guess it would change > > the order of cleanup at the end of the function. > > Cleanup has bitmap_clear w

Re: [PATCH v3] powerpc/fadump: sysfs for fadump memory reservation

2019-09-18 Thread Sourabh Jain
On 8/27/19 11:32 AM, Hari Bathini wrote: > > > On 27/08/19 8:49 AM, Michael Ellerman wrote: >> Hari Bathini writes: >>> On 26/08/19 4:14 PM, Sourabh Jain wrote: On 8/26/19 3:46 PM, Sourabh Jain wrote: > On 8/26/19 3:29 PM, Hari Bathini wrote: >> On 10/08/19 11:29 PM, Sourabh Jain

Re: [PATCH] mm/pgtable/debug: Fix test validating architecture page table helpers

2019-09-18 Thread Anshuman Khandual
On 09/13/2019 11:53 AM, Christophe Leroy wrote: > Fix build failure on powerpc. > > Fix preemption imbalance. > > Signed-off-by: Christophe Leroy > --- > mm/arch_pgtable_test.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/mm/arch_pgtable_test.c b/mm/arch_pgtable_test.c > inde

Re: [PATCH v8 8/8] KVM: PPC: Ultravisor: Add PPC_UV config option

2019-09-18 Thread Bharata B Rao
On Tue, Sep 17, 2019 at 04:37:07PM -0700, Sukadev Bhattiprolu wrote: > Bharata B Rao [bhar...@linux.ibm.com] wrote: > > From: Anshuman Khandual > > > > CONFIG_PPC_UV adds support for ultravisor. > > > > Signed-off-by: Anshuman Khandual > > Signed-off-by: Bharata B Rao > > Signed-off-by: Ram Pa

Re: [PATCH v8 7/8] kvmppc: Support reset of secure guest

2019-09-18 Thread Bharata B Rao
On Tue, Sep 17, 2019 at 04:27:36PM -0700, Sukadev Bhattiprolu wrote: > > + > > + if (kvmppc_is_guest_secure(kvm)) { > > Nit: Since this entire function only applies to secure guests we could > return here for normal guests. Yes, can be done. > > bool kvmppc_is_guest_secure(struct kvm *kvm) >

Re: [PATCH v8 4/8] kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls

2019-09-18 Thread Bharata B Rao
On Tue, Sep 17, 2019 at 04:35:02PM -0700, Sukadev Bhattiprolu wrote: > > > +unsigned long kvmppc_h_svm_init_done(struct kvm *kvm) > > +{ > > + if (!(kvm->arch.secure_guest & KVMPPC_SECURE_INIT_START)) > > Minor: Should we also check if KVMPPC_SECURE_INIT_DONE is set here (since > both can be se

Re: [PATCH v8 2/8] kvmppc: Movement of pages between normal and secure memory

2019-09-18 Thread Bharata B Rao
On Tue, Sep 17, 2019 at 04:31:39PM -0700, Sukadev Bhattiprolu wrote: > > Minor: Can this allocation be outside the lock? I guess it would change > the order of cleanup at the end of the function. Cleanup has bitmap_clear which needs be under spinlock, so this order of setup/alloc and cleanup will

Re: [PATCH 0/2] pseries/hotplug: Change the default behaviour of cede_offline

2019-09-18 Thread Naveen N. Rao
Michael Ellerman wrote: "Gautham R. Shenoy" writes: From: "Gautham R. Shenoy" Currently on Pseries Linux Guests, the offlined CPU can be put to one of the following two states: - Long term processor cede (also called extended cede) - Returned to the Hypervisor via RTAS "stop-self" call.

[PATCH V2 4/4] ASoC: fsl_asrc: Fix error with S24_3LE format bitstream in i.MX8

2019-09-18 Thread Shengjiu Wang
There is error "aplay: pcm_write:2023: write error: Input/output error" on i.MX8QM/i.MX8QXP platform for S24_3LE format. In i.MX8QM/i.MX8QXP, the DMA is EDMA, which don't support 24bit sample, but we didn't add any constraint, that cause issues. So we need to query the caps of dma, then update th