* [PATCH] 2.4: Preemption fixes for Broadcom DMA Page operations
@ 2004-12-02 0:33 Manish Lachwani
2004-12-02 0:49 ` Ralf Baechle
2004-12-02 0:52 ` Maciej W. Rozycki
0 siblings, 2 replies; 4+ messages in thread
From: Manish Lachwani @ 2004-12-02 0:33 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
[-- Attachment #1: Type: text/plain, Size: 148 bytes --]
Hello !
The attached patch implements preempt_disable/preempt_enable around the SB1 DMA
page operations. Please review ...
Thanks
Manish Lachwani
[-- Attachment #2: patch-bcm91125-dma --]
[-- Type: text/plain, Size: 3258 bytes --]
--- arch/mips/mm/pg-sb1.c.orig 2004-12-01 10:59:53.000000000 -0800
+++ arch/mips/mm/pg-sb1.c 2004-12-01 11:08:59.000000000 -0800
@@ -157,7 +157,11 @@
void sb1_dma_init(void)
{
- int cpu = smp_processor_id();
+ int cpu;
+
+ preempt_disable();
+
+ cpu = smp_processor_id();
uint64_t base_val = PHYSADDR(&page_descr[cpu]) | V_DM_DSCR_BASE_RINGSZ(1);
out64(base_val,
@@ -166,15 +170,23 @@
IO_SPACE_BASE + A_DM_REGISTER(cpu, R_DM_DSCR_BASE));
out64(base_val | M_DM_DSCR_BASE_ENABL,
IO_SPACE_BASE + A_DM_REGISTER(cpu, R_DM_DSCR_BASE));
+
+ preempt_enable();
}
void sb1_clear_page_dma(void *page)
{
- int cpu = smp_processor_id();
+ int cpu;
+
+ preempt_disable();
+
+ cpu = smp_processor_id();
/* if the page is above Kseg0, use old way */
- if (KSEGX(page) != K0BASE)
+ if (KSEGX(page) != K0BASE) {
+ preempt_enable();
return sb1_clear_page(page);
+ }
page_descr[cpu].dscr_a = PHYSADDR(page) | M_DM_DSCRA_ZERO_MEM | M_DM_DSCRA_L2C_DEST | M_DM_DSCRA_INTERRUPT;
page_descr[cpu].dscr_b = V_DM_DSCRB_SRC_LENGTH(PAGE_SIZE);
@@ -187,17 +199,27 @@
while (!(in64(IO_SPACE_BASE + A_DM_REGISTER(cpu, R_DM_DSCR_BASE_DEBUG)) & M_DM_DSCR_BASE_INTERRUPT))
;
in64(IO_SPACE_BASE + A_DM_REGISTER(cpu, R_DM_DSCR_BASE));
+
+ preempt_enable();
}
void sb1_copy_page_dma(void *to, void *from)
{
- unsigned long from_phys = PHYSADDR(from);
- unsigned long to_phys = PHYSADDR(to);
- int cpu = smp_processor_id();
+ unsigned long from_phys;
+ unsigned long to_phys;
+ int cpu;
+
+ preempt_disable();
+
+ from_phys = PHYSADDR(from);
+ to_phys = PHYSADDR(to);
+ cpu = smp_processor_id();
/* if either page is above Kseg0, use old way */
- if ((KSEGX(to) != K0BASE) || (KSEGX(from) != K0BASE))
+ if ((KSEGX(to) != K0BASE) || (KSEGX(from) != K0BASE)) {
+ preempt_enable();
return sb1_copy_page(to, from);
+ }
page_descr[cpu].dscr_a = PHYSADDR(to_phys) | M_DM_DSCRA_L2C_DEST | M_DM_DSCRA_INTERRUPT;
page_descr[cpu].dscr_b = PHYSADDR(from_phys) | V_DM_DSCRB_SRC_LENGTH(PAGE_SIZE);
@@ -210,6 +232,8 @@
while (!(in64(IO_SPACE_BASE + A_DM_REGISTER(cpu, R_DM_DSCR_BASE_DEBUG)) & M_DM_DSCR_BASE_INTERRUPT))
;
in64(IO_SPACE_BASE + A_DM_REGISTER(cpu, R_DM_DSCR_BASE));
+
+ preempt_enable();
}
#endif
--- drivers/char/Config.in.orig 2004-12-01 10:33:59.000000000 -0800
+++ drivers/char/Config.in 2004-12-01 10:34:22.000000000 -0800
@@ -178,7 +178,7 @@
define_bool CONFIG_AU1X00_USB_DEVICE y
fi
fi
- if [ "$CONFIG_SIBYTE_SB1250" = "y" ]; then
+ if [ "$CONFIG_SIBYTE_BOARD" = "y" ]; then
bool ' Support for sb1250 onchip DUART' CONFIG_SIBYTE_SB1250_DUART
if [ "$CONFIG_SIBYTE_SB1250_DUART" = "y" ]; then
bool ' Console on SB1250 DUART' CONFIG_SIBYTE_SB1250_DUART_CONSOLE
--- drivers/net/Config.in.orig 2004-12-01 10:41:37.000000000 -0800
+++ drivers/net/Config.in 2004-12-01 10:41:46.000000000 -0800
@@ -104,7 +104,7 @@
if [ "$CONFIG_IDT_79EB434" = "y" ]; then
bool ' IDT RC32434 Ethernet support' CONFIG_IDT_RC32434_ETH
fi
- if [ "$CONFIG_SIBYTE_SB1250" = "y" ]; then
+ if [ "$CONFIG_SIBYTE_BOARD" = "y" ]; then
tristate ' SB1250 Ethernet support' CONFIG_NET_SB1250_MAC
fi
if [ "$CONFIG_SGI_IP27" = "y" ]; then
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] 2.4: Preemption fixes for Broadcom DMA Page operations
2004-12-02 0:33 [PATCH] 2.4: Preemption fixes for Broadcom DMA Page operations Manish Lachwani
@ 2004-12-02 0:49 ` Ralf Baechle
2004-12-02 0:52 ` Maciej W. Rozycki
1 sibling, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2004-12-02 0:49 UTC (permalink / raw)
To: Manish Lachwani; +Cc: linux-mips
On Wed, Dec 01, 2004 at 04:33:08PM -0800, Manish Lachwani wrote:
> The attached patch implements preempt_disable/preempt_enable around the SB1 DMA
> page operations. Please review ...
We don't support preemption in 2.4 -> bitbucket.
Ralf
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] 2.4: Preemption fixes for Broadcom DMA Page operations
2004-12-02 0:33 [PATCH] 2.4: Preemption fixes for Broadcom DMA Page operations Manish Lachwani
2004-12-02 0:49 ` Ralf Baechle
@ 2004-12-02 0:52 ` Maciej W. Rozycki
2004-12-02 0:58 ` Manish Lachwani
1 sibling, 1 reply; 4+ messages in thread
From: Maciej W. Rozycki @ 2004-12-02 0:52 UTC (permalink / raw)
To: Manish Lachwani; +Cc: linux-mips, ralf
On Wed, 1 Dec 2004, Manish Lachwani wrote:
> The attached patch implements preempt_disable/preempt_enable around the
> SB1 DMA page operations. Please review ...
Why is it needed?
Also I think these:
- if [ "$CONFIG_SIBYTE_SB1250" = "y" ]; then
+ if [ "$CONFIG_SIBYTE_BOARD" = "y" ]; then
are unrelated and inaccurate. The devices are internal to the SoCs and
not strictly board-dependent. How about:
+ if [ "$CONFIG_SIBYTE_SB1250" = "y" || "$CONFIG_SIBYTE_BCM112X" = "y"]; then
at the very least, or perhaps using reverse dependencies?
Maciej
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] 2.4: Preemption fixes for Broadcom DMA Page operations
2004-12-02 0:52 ` Maciej W. Rozycki
@ 2004-12-02 0:58 ` Manish Lachwani
0 siblings, 0 replies; 4+ messages in thread
From: Manish Lachwani @ 2004-12-02 0:58 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: linux-mips, ralf
Hi Maciej,
Maciej W. Rozycki wrote:
> On Wed, 1 Dec 2004, Manish Lachwani wrote:
>
>
>>The attached patch implements preempt_disable/preempt_enable around the
>>SB1 DMA page operations. Please review ...
>
>
> Why is it needed?
>
> Also I think these:
>
> - if [ "$CONFIG_SIBYTE_SB1250" = "y" ]; then
> + if [ "$CONFIG_SIBYTE_BOARD" = "y" ]; then
>
> are unrelated and inaccurate. The devices are internal to the SoCs and
> not strictly board-dependent. How about:
>
> + if [ "$CONFIG_SIBYTE_SB1250" = "y" || "$CONFIG_SIBYTE_BCM112X" = "y"]; then
Actually, this makes more sense. I will send a new patch
Thanks
Manish Lachwani
>
> at the very least, or perhaps using reverse dependencies?
>
> Maciej
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-12-02 0:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-02 0:33 [PATCH] 2.4: Preemption fixes for Broadcom DMA Page operations Manish Lachwani
2004-12-02 0:49 ` Ralf Baechle
2004-12-02 0:52 ` Maciej W. Rozycki
2004-12-02 0:58 ` Manish Lachwani
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.